예제 #1
0
  protected function _Load($name)
  {
    $tpl_path = $this->_TemplatePath($name);

    $data = @file_get_contents($tpl_path);
    if ($data === FALSE)
      throw new TemplateLoaderException('Could not load template ' . $name);

    $template = Template::NewWithData($name, $data);

    if ($this->cache_backend) {
      $this->cache_backend->StoreCompiledTemplate(
          $name, filemtime($tpl_path), $template->template());
    }

    return $template;
  }
예제 #2
0
파일: template.php 프로젝트: rsesek/hoplite
 static public function NewWithData($name, $data)
 {
   $template = new Template($name);
   $template->data = $template->_ProcessTemplate($data);
   return $template;
 }