Exemplo n.º 1
0
 public static function sendTemplate($sFileName, $aContext = [], $sScriptToInject = '', $sCssToInject = '')
 {
     if (file_exists($sFileName)) {
         self::setHeader('Cache-Control', 'no-cache');
         self::setHeader('Pragma', 'no-cache');
         self::setHeader('Expires', '-1');
         $sEvaledTemplate = Processor::evalFile($sFileName, $aContext, false);
         $sScriptToInject .= T::getJs();
         $sCssToInject .= T::getCss();
         return self::sendHtml($sEvaledTemplate, $sScriptToInject, $sCssToInject, false);
     } else {
         throw new Exception("Error: file {$sFileName} does not exist", 404);
     }
 }