Beispiel #1
0
 public function renderTemplate($templateName, $parameters = array())
 {
     $controller = strtolower($this->name);
     $path = Manager::getBasePath('/views/' . $controller . '/', $this->module);
     $file = $templateName . '.html';
     if (file_exists($path . '/' . $file)) {
         $template = new \Maestro\UI\MTemplate($path);
         $template->load($file);
         $this->getParameters($parameters);
         $object = (object) ['template' => $template, 'parameters' => $this->data];
         $this->setResult(new Results\MRenderTemplate($object));
     } else {
         throw new ENotFoundException(_M("Template [%s] was not found!", array($templateName)));
     }
 }