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