Beispiel #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;
  }
Beispiel #2
0
 static public function NewWithData($name, $data)
 {
   $template = new Template($name);
   $template->data = $template->_ProcessTemplate($data);
   return $template;
 }