src/Ace/Commands/Core/BuildCommand.php
/**
	 * Renders all view templates.
	 *
	 * @return void
	 */
Renders all view templates.
@return void
Renders all view templates . @return void
protected function renderViews(OutputInterface $out) {
		Application::kernel()->view()->boot();
		$loaders = Application::kernel()->view()->getLoaders();
		$numFiles = 0;
		foreach ($loaders as $loader) {
			foreach ($loader->resolveAll() as $fileName) {
				$showName = $this->getRelativeName($fileName);
				$out->writeln("<fg=yellow>[ᐅ]</> compile $showName");
				$numFiles++;
				if ($loader instanceof ComponentLoader) {
					$componentName = substr($fileName, strlen($loader->getPath()) + 1);
					$componentName = preg_replace("/(\.blade\.php|\.twig|\.html)$/", "", $componentName);
					$fileName = str_replace('\\', '/', "@component/$componentName");
					Application::kernel()->view()->componentManager()->prepare($componentName);
				}
				else {
					$fileName = substr($fileName, strlen($loader->getPath()) + 1);
					$fileName = str_replace('\\', '/', $fileName);
				}
				try {
					$template = new Template($fileName);
					$template->cache();
				}
				catch (Exception $ex) {
					if ($ex instanceof SyntaxError) {
						$message = lcfirst(rtrim($ex->getMessage(), '.'));
						$line = $ex->getLine();
						$out->writeln("<fg=red>[!]</> syntax error in $showName: $message on line $line");
					}
					else {
						$out->writeln("<fg=red>[!]</> error in $showName: {$ex->__toString()}");
					}
					$this->exit(1);
				}
			}
		}
		$out->writeln('<fg=green>[✓]</> ' . ($numFiles === 0 ? 'nothing to do' : 'cached views'));
	}
protected function renderViews ( OutputInterface $ out ) { Application :: kernel ( ) -> view ( ) -> boot ( ) ; $ loaders = Application :: kernel ( ) -> view ( ) -> getLoaders ( ) ; $ numFiles = 0 ; foreach ( $ loaders as $ loader ) { foreach ( $ loader -> resolveAll ( ) as $ fileName ) { $ showName = $ this -> getRelativeName ( $ fileName ) ; $ out -> writeln ( " <fg=yellow>[ᐅ]</> compile $s h owName") ; $ numFiles ++ ; if ( $ loader instanceof ComponentLoader ) { $ componentName = substr ( $ fileName , strlen ( $ loader -> getPath ( ) ) + 1 ) ; $ componentName = preg_replace ( " /(\.blade\.php|\.twig|\.html)$/ " , " " , $ componentName ) ; $ fileName = str_replace ( '\\' , '/' , " @component/ $ componentName " ) ; Application :: kernel ( ) -> view ( ) -> componentManager ( ) -> prepare ( $ componentName ) ; } else { $ fileName = substr ( $ fileName , strlen ( $ loader -> getPath ( ) ) + 1 ) ; $ fileName = str_replace ( '\\' , '/' , $ fileName ) ; } try { $ template = new Template ( $ fileName ) ; $ template -> cache ( ) ; } catch ( Exception $ ex ) { if ( $ ex instanceof SyntaxError ) { $ message = lcfirst ( rtrim ( $ ex -> getMessage ( ) , '.' ) ) ; $ line = $ ex -> getLine ( ) ; $ out -> writeln ( " <fg=red>[!]</> syntax error in  $ showName :  $ message  on line  $ line " ) ; } else { $ out -> writeln ( " <fg=red>[!]</> error in  $ showName :  { $ ex -> __toString ( ) } " ) ; } $ this -> exit ( 1 ) ; } } } $ out -> writeln ( '<fg=green>[✓]</> ' . ( n u mFiles = = 0 ? ' othing to do' : ' ached views')) ; }
Renders all view templates.
Renders all view templates .
// Convert component file names to their @component/name equivalents // This is essential for component-specific template features to be used in the compilation // Manually warm the component manager // Calculate the path relative to the loader's directory