src/PatternLab/PatternEngine/Twig/TwigUtil.php
public static function loadFunctions() {
		
		// load defaults
		$functionDir = Config::getOption("sourceDir").DIRECTORY_SEPARATOR."_twig-components/functions";
		$functionExt = Config::getOption("twigFunctionExt");
		$functionExt = $functionExt ? $functionExt : "function.php";
		
		if (is_dir($functionDir)) {
			
			// loop through the function dir...
			$finder = new Finder();
			$finder->files()->name("*\.".$functionExt)->in($functionDir);
			$finder->sortByName();
			foreach ($finder as $file) {
				
				// see if the file should be ignored or not
				$baseName = $file->getBasename();
				if ($baseName[0] != "_") {
					
					include($file->getPathname());
					
					// $function should be defined in the included file
					if (isset($function)) {
						self::$instance->addFunction($function);
						unset($function);
					}
					
				}
				
			}
			
		}
		
	}
public static function loadFunctions() {
		
		// load defaults
		$functionDir = Config::getOption("sourceDir").DIRECTORY_SEPARATOR."_twig-components/functions";
		$functionExt = Config::getOption("twigFunctionExt");
		$functionExt = $functionExt ? $functionExt : "function.php";
		
		if (is_dir($functionDir)) {
			
			// loop through the function dir...
			$finder = new Finder();
			$finder->files()->name("*\.".$functionExt)->in($functionDir);
			$finder->sortByName();
			foreach ($finder as $file) {
				
				// see if the file should be ignored or not
				$baseName = $file->getBasename();
				if ($baseName[0] != "_") {
					
					include($file->getPathname());
					
					// $function should be defined in the included file
					if (isset($function)) {
						self::$instance->addFunction($function);
						unset($function);
					}
					
				}
				
			}
			
		}
		
	}
public static function loadFunctions ( ) { // load defaults $ functionDir = Config :: getOption ( "sourceDir" ) . DIRECTORY_SEPARATOR . "_twig-components/functions" ; $ functionExt = Config :: getOption ( "twigFunctionExt" ) ; $ functionExt = $ functionExt ? $ functionExt : "function.php" ; if ( is_dir ( $ functionDir ) ) { // loop through the function dir... $ finder = new Finder ( ) ; $ finder -> files ( ) -> name ( "*\." . $ functionExt ) -> in ( $ functionDir ) ; $ finder -> sortByName ( ) ; foreach ( $ finder as $ file ) { // see if the file should be ignored or not $ baseName = $ file -> getBasename ( ) ; if ( $ baseName [ 0 ] != "_" ) { include ( $ file -> getPathname ( ) ) ; // $function should be defined in the included file if ( isset ( $ function ) ) { self :: $ instance -> addFunction ( $ function ) ; unset ( $ function ) ; } } } } }
Load functions for the Twig PatternEngine
Load functions for the Twig PatternEngine