Example #1
0
 public static function __callStatic($sTemplate, $aArgs)
 {
     if ($aDirs = M::TEMPLATE_PHP()) {
         foreach ($aDirs as $sDir) {
             $sPath = M::PROJECT_ROOT() . '/' . $sDir . '/tpl.' . $sTemplate . '.php';
             if (file_exists($sPath)) {
                 self::_findJsFile($sTemplate);
                 self::_findCssFile($sTemplate);
                 if (isset($aArgs[0])) {
                     print Processor::evalString(file_get_contents($sPath), $aArgs[0]);
                 }
                 return;
             }
         }
     }
     throw new Exception("Template \"{$sTemplate}\" is not found");
 }