function compileTemplate($tpl, $keyData, $uri, $res, $templatePath, &$extraParameters, &$resourceData)
 {
     $key = $this->cacheKey($keyData, $res, $templatePath, $extraParameters);
     return eZTemplateCompiler::compileTemplate($tpl, $key, $resourceData);
 }
Пример #2
0
 function compileTemplateFile($file, $returnResourceData = false)
 {
     $this->resetErrorLog();
     if (!file_exists($file)) {
         return false;
     }
     $resourceHandler = $this->resourceFor($file, $resourceName, $templateName);
     if (!$resourceHandler) {
         return false;
     }
     $resourceData = $this->resourceData($resourceHandler, $file, $resourceName, $templateName);
     $resourceData['key-data'] = "file:" . $file;
     $key = md5($resourceData['key-data']);
     $extraParameters = array();
     $resourceHandler->handleResource($this, $resourceData, eZTemplate::RESOURCE_FETCH, $extraParameters);
     $isCompiled = false;
     if (isset($resourceData['compiled-template'])) {
         $isCompiled = $resourceData['compiled-template'];
     }
     if (!$isCompiled) {
         $root =& $resourceData['root-node'];
         $root = array(eZTemplate::NODE_ROOT, false);
         $templateText = $resourceData["text"];
         $rootNamespace = '';
         $this->parse($templateText, $root, $rootNamespace, $resourceData);
         if (eZTemplate::isDebugEnabled()) {
             $this->appendDebugNodes($root, $resourceData);
         }
         $result = eZTemplateCompiler::compileTemplate($this, $key, $resourceData);
     } else {
         $result = true;
     }
     if ($returnResourceData) {
         $resourceData['result'] = $result;
         return $resourceData;
     }
     return $result;
 }