Ejemplo n.º 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");
 }
Ejemplo n.º 2
0
 public static function send($sContent, $bEval = true)
 {
     self::$_sCurrentFileName = '';
     if ($bEval) {
         print Processor::evalString($sContent);
     } else {
         print $sContent;
     }
     self::$_bReadyToSend = true;
 }