Skip to content

Commit

Permalink
Removing ability to register View and ThemeView into ClassRegistry.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 11, 2010
1 parent dfa5273 commit 65c2350
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 22 deletions.
5 changes: 2 additions & 3 deletions cake/libs/view/theme.php
Expand Up @@ -36,10 +36,9 @@ class ThemeView extends View {
* Constructor for ThemeView sets $this->theme.
*
* @param Controller $controller Controller object to be rendered.
* @param boolean $register Should the view be registered in the registry.
*/
function __construct(&$controller, $register = true) {
parent::__construct($controller, $register);
function __construct(&$controller) {
parent::__construct($controller);
$this->theme =& $controller->theme;
}

Expand Down
9 changes: 2 additions & 7 deletions cake/libs/view/view.php
Expand Up @@ -41,6 +41,7 @@ class View extends Object {
* @var HelperCollection
*/
public $Helpers;

/**
* Path parts for creating links in views.
*
Expand Down Expand Up @@ -300,10 +301,8 @@ class View extends Object {
* Constructor
*
* @param Controller $controller A controller object to pull View::__passedArgs from.
* @param boolean $register Should the View instance be registered in the ClassRegistry
* @return View
*/
function __construct(&$controller, $register = true) {
function __construct(&$controller) {
if (is_object($controller)) {
$count = count($this->__passedVars);
for ($j = 0; $j < $count; $j++) {
Expand All @@ -313,10 +312,6 @@ function __construct(&$controller, $register = true) {
}
$this->Helpers = new HelperCollection($this);
parent::__construct();

if ($register) {
ClassRegistry::addObject('view', $this);
}
}

/**
Expand Down
12 changes: 0 additions & 12 deletions cake/tests/cases/libs/view/theme.test.php
Expand Up @@ -173,18 +173,6 @@ function tearDown() {
ClassRegistry::flush();
App::build();
}
/**
* test that the theme view can be constructed without going into the registry
*
* @return void
*/
function testConstructionNoRegister() {
ClassRegistry::flush();
$controller = null;
$Theme = new ThemeView($controller, false);
$ThemeTwo = ClassRegistry::getObject('view');
$this->assertFalse($ThemeTwo);
}

/**
* testPluginGetTemplate method
Expand Down

0 comments on commit 65c2350

Please sign in to comment.