Exemple #1
0
 /**
  * Renders the current action
  */
 public function render()
 {
     $this->set('rox_page_title', $this->pageTitle);
     foreach ($this->helpers as $helper) {
         $helperName = Inflector::lowerCamelize($helper);
         $this->set($helperName, Rox::getHelper($helper));
     }
     $viewPath = $this->params['controller'];
     if (!empty($this->params['namespace'])) {
         $simpleControllerName = substr($this->params['controller'], strlen($this->params['namespace']) + 1);
         $viewPath = $this->params['namespace'] . '/' . $simpleControllerName;
     }
     $viewName = $this->params['action'];
     $view = new \rox\template\View($this->_viewVars);
     $view->response = $this->response;
     $view->params = $this->params;
     $this->response->body = $view->render($viewPath, $viewName, $this->layout);
 }
Exemple #2
0
 public function __get($attribute)
 {
     $this->{$attribute} = Rox::getHelper($attribute);
     return $this->{$attribute};
 }