Ejemplo n.º 1
0
 /**
  * Renders a particular action for this scope, assigning local
  * view variables and global view variables.
  *
  * @param string $action The unqualified action name (i.e. 'noroute') to render
  * @return string The rendered action from the template processing
  */
 public function render($action)
 {
     $templateFile = $this->getTemplatePathByAction($action);
     if (!$templateFile || !file_exists($templateFile)) {
         throw new Primitus_View_Exception("Could not find expected template '{$templateFile}");
     }
     $engine = new Primitus_View_Engine();
     foreach (self::$_global_tpl_vars as $key => $value) {
         $engine->assign($key, $value);
     }
     foreach ($this->_local_tpl_vars as $key => $value) {
         $engine->assign($key, $value);
     }
     return $engine->fetch($templateFile);
 }