public function getTemplate($filename)
 {
     $resource = 'file';
     if (strpos($filename, ':') !== FALSE) {
         $data = explode(':', $filename);
         $filename = $data[1];
         $resource = $data[0];
         if (!isset($this->resources[$resource])) {
             $this->error(E_USER_ERROR, 'Specified resource type: ' . $resource . ' does not exist.', OPT_E_RESOURCE_NOT_FOUND);
         }
         $callback = $this->resources[$resource];
     }
     $compiler = new optCompiler($this->compiler);
     if ($resource == 'file') {
         $result = file_get_contents($this->root . $filename);
     } else {
         $result = $callback($this, $filename);
     }
     return $compiler->parse(NULL, $result);
 }
Example #2
0
 public function getTemplate($filename)
 {
     $compiler = new optCompiler($this->compiler);
     return $compiler->parse(NULL, file_get_contents($this->root . $filename));
 }