diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index f2fdc7c4c11..790460064a6 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -147,13 +147,6 @@ class Controller extends Object implements EventListener { */ public $layoutPath = null; -/** - * Contains variables to be handed to the view. - * - * @var array - */ - public $viewVars = array(); - /** * The name of the view file to render. The name specified * is the filename in /app/View/ without the .ctp extension. diff --git a/lib/Cake/Test/TestCase/Console/Command/Task/TemplateTaskTest.php b/lib/Cake/Test/TestCase/Console/Command/Task/TemplateTaskTest.php index f7a0cfe78b8..c5dead24075 100644 --- a/lib/Cake/Test/TestCase/Console/Command/Task/TemplateTaskTest.php +++ b/lib/Cake/Test/TestCase/Console/Command/Task/TemplateTaskTest.php @@ -65,20 +65,20 @@ public function tearDown() { */ public function testSet() { $this->Task->set('one', 'two'); - $this->assertTrue(isset($this->Task->templateVars['one'])); - $this->assertEquals('two', $this->Task->templateVars['one']); + $this->assertTrue(isset($this->Task->viewVars['one'])); + $this->assertEquals('two', $this->Task->viewVars['one']); $this->Task->set(array('one' => 'three', 'four' => 'five')); - $this->assertTrue(isset($this->Task->templateVars['one'])); - $this->assertEquals('three', $this->Task->templateVars['one']); - $this->assertTrue(isset($this->Task->templateVars['four'])); - $this->assertEquals('five', $this->Task->templateVars['four']); + $this->assertTrue(isset($this->Task->viewVars['one'])); + $this->assertEquals('three', $this->Task->viewVars['one']); + $this->assertTrue(isset($this->Task->viewVars['four'])); + $this->assertEquals('five', $this->Task->viewVars['four']); - $this->Task->templateVars = array(); + $this->Task->viewVars = array(); $this->Task->set(array(3 => 'three', 4 => 'four')); $this->Task->set(array(1 => 'one', 2 => 'two')); $expected = array(3 => 'three', 4 => 'four', 1 => 'one', 2 => 'two'); - $this->assertEquals($expected, $this->Task->templateVars); + $this->assertEquals($expected, $this->Task->viewVars); } /** diff --git a/lib/Cake/Utility/ViewVarsTrait.php b/lib/Cake/Utility/ViewVarsTrait.php index 9956ca8d9ab..a3647f61bb3 100644 --- a/lib/Cake/Utility/ViewVarsTrait.php +++ b/lib/Cake/Utility/ViewVarsTrait.php @@ -23,6 +23,11 @@ */ trait ViewVarsTrait { +/** + * Variables for the view + * + * @var array + */ public $viewVars = array(); /** diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index aebc3230d89..78024df0b4d 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -119,13 +119,6 @@ class View extends Object { */ public $viewPath = null; -/** - * Variables for the view - * - * @var array - */ - public $viewVars = array(); - /** * Name of view to use with this View. *