Skip to content
Permalink
Browse files

Adding temporary $View property to controller until I figure out a be…

…tter way to provide access for it. Test case updated to reflect View not being in the registry anymore.
  • Loading branch information...
markstory committed Jul 15, 2010
1 parent 07a7e18 commit d01708b1ef790bcdb4238cce7252b79b7900d4c9
Showing with 9 additions and 1 deletion.
  1. +8 −0 cake/libs/controller/controller.php
  2. +1 −1 cake/tests/cases/libs/controller/controller.test.php
@@ -212,6 +212,13 @@ class Controller extends Object {
*/
public $view = 'View';
/**
* Instance of the View created during rendering. Won't be set until after Controller::render() is called.
*
* @var View
*/
public $View;
/**
* File extension for view templates. Defaults to Cake's conventional ".ctp".
*
@@ -847,6 +854,7 @@ public function render($action = null, $layout = null, $file = null) {
$this->autoRender = false;
$this->output .= $View->render($action, $layout, $file);
$this->View = $View;
return $this->output;
}
@@ -924,7 +924,7 @@ function testRender() {
ClassRegistry::flush();
$Controller->viewPath = 'posts';
$result = $Controller->render('index');
$View = ClassRegistry::getObject('view');
$View = $Controller->View;
$this->assertTrue(isset($View->validationErrors['ControllerComment']));
$this->assertEqual($expected, $View->validationErrors['ControllerComment']);

0 comments on commit d01708b

Please sign in to comment.
You can’t perform that action at this time.