public function render($action = null, $layout = null, $file = null) { if (!$this->testView) { $this->renderedAction = $action; } else { return parent::render($action, $layout, $file); } }
public function render($action = null, $layout = null, $file = null) { if (is_null($action)) { $action = $this->action; } if (!file_exists(VIEWS . $this->viewPath . DS . $action . '.ctp')) { $file = App::pluginPath('users') . 'views' . DS . 'users' . DS . $action . '.ctp'; } return parent::render($action, $layout, $file); }
public function render($action = null, $layout = null) { if (is_null($action)) { $action = $this->action; } $view = ROOT . DS . APP_DIR . DS . 'View' . DS . $this->viewPath . DS . $action . '.ctp'; if (!file_exists(ROOT . DS . APP_DIR . DS . 'View' . DS . $this->viewPath . DS . $action . '.ctp')) { $view = App::pluginPath('Users') . 'View' . DS . 'Users' . DS . $action . '.ctp'; } return parent::render($view, $layout); }
public function render($view = null, $layout = null) { if (is_null($view)) { $view = $this->action; } $viewPath = substr(get_class($this), 0, strlen(get_class($this)) - 10); if (!file_exists(APP . 'View' . DS . $viewPath . DS . $view . '.ctp')) { $this->plugin = 'Users'; } else { $this->viewPath = $viewPath; } return parent::render($view, $layout); }
public function testRender() { $request = new RequestAggregate(); $request->setRequest(new Param('/Users/index/1')); $controller = new UsersController($request); $controller->invokeAction($request); $output = $controller->render('index'); $expect = '<div><p>bar</p> </div> '; $this->expectOutputString($expect); echo $output; }