Ejemplo n.º 1
0
 /**
  * Renders view for given action and layout. If $file is given, that is used
  * for a view filename (e.g. customFunkyView.ctp).
  *
  * @param string $action Name of action to render for
  * @param string $layout Layout to use
  * @param string $file Custom filename for view
  * @return string Rendered Element
  */
 public function render($action = null, $layout = null, $file = null)
 {
     if ($layout === null) {
         $layout = $this->layout;
     }
     if ($layout && $this->autoLayout) {
         Pheme::push("layouts/pheme/{$layout}");
     }
     $data = parent::render($action, $layout, $file);
     if ($layout && $this->autoLayout) {
         Pheme::pop();
     }
     // Save title for cross-request manipulations
     SlConfigure::write('View.lastRenderTitle', empty($this->viewVars['title']) ? null : $this->viewVars['title']);
     return $data;
 }