src/PatternLab/PatternEngine/Twig/TwigUtil.php
public static function loadTags() {
		
		// load defaults
		$tagDir = Config::getOption("sourceDir").DIRECTORY_SEPARATOR."_twig-components/tags";
		$tagExt = Config::getOption("twigTagExt");
		$tagExt = $tagExt ? $tagExt : "tag.php";
		
		if (is_dir($tagDir)) {
			
			// loop through the tags and instantiate the class...
			$finder = new Finder();
			$finder->files()->name("*\.".$tagExt)->in($tagDir);
			$finder->sortByName();
			foreach ($finder as $file) {
				
				// see if the file should be ignored or not
				$baseName = $file->getBasename();
				if ($baseName[0] != "_") {
					
					include($file->getPathname());
					
					// Project_{filenameBase}_TokenParser should be defined in the include
					$className = "Project_".$file->getBasename(".".$tagExt)."_TokenParser";
					self::$instance->addTokenParser(new $className());
					
				}
				
			}
			
		}
		
	}
public static function loadTags() {
		
		// load defaults
		$tagDir = Config::getOption("sourceDir").DIRECTORY_SEPARATOR."_twig-components/tags";
		$tagExt = Config::getOption("twigTagExt");
		$tagExt = $tagExt ? $tagExt : "tag.php";
		
		if (is_dir($tagDir)) {
			
			// loop through the tags and instantiate the class...
			$finder = new Finder();
			$finder->files()->name("*\.".$tagExt)->in($tagDir);
			$finder->sortByName();
			foreach ($finder as $file) {
				
				// see if the file should be ignored or not
				$baseName = $file->getBasename();
				if ($baseName[0] != "_") {
					
					include($file->getPathname());
					
					// Project_{filenameBase}_TokenParser should be defined in the include
					$className = "Project_".$file->getBasename(".".$tagExt)."_TokenParser";
					self::$instance->addTokenParser(new $className());
					
				}
				
			}
			
		}
		
	}
public static function loadTags ( ) { // load defaults $ tagDir = Config :: getOption ( "sourceDir" ) . DIRECTORY_SEPARATOR . "_twig-components/tags" ; $ tagExt = Config :: getOption ( "twigTagExt" ) ; $ tagExt = $ tagExt ? $ tagExt : "tag.php" ; if ( is_dir ( $ tagDir ) ) { // loop through the tags and instantiate the class... $ finder = new Finder ( ) ; $ finder -> files ( ) -> name ( "*\." . $ tagExt ) -> in ( $ tagDir ) ; $ finder -> sortByName ( ) ; foreach ( $ finder as $ file ) { // see if the file should be ignored or not $ baseName = $ file -> getBasename ( ) ; if ( $ baseName [ 0 ] != "_" ) { include ( $ file -> getPathname ( ) ) ; // Project_{filenameBase}_TokenParser should be defined in the include $ className = "Project_" . $ file -> getBasename ( "." . $ tagExt ) . "_TokenParser" ; self :: $ instance -> addTokenParser ( new $ className ( ) ) ; } } } }
Load tags for the Twig PatternEngine
Load tags for the Twig PatternEngine