Adding fix for Ticket #1219.

Checking for an object being passed.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3306 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-07-27 17:13:02 +00:00
parent 5549ddfd75
commit 0ae0905004

View file

@ -213,24 +213,26 @@ class View extends Object{
* @return View
*/
function __construct(&$controller) {
$this->controller =& $controller;
$this->_viewVars = $this->controller->_viewVars;
$this->action = $this->controller->action;
$this->autoLayout = $this->controller->autoLayout;
$this->autoRender = $this->controller->autoRender;
$this->base = $this->controller->base;
$this->webroot = $this->controller->webroot;
$this->helpers = $this->controller->helpers;
$this->here = $this->controller->here;
$this->layout = $this->controller->layout;
$this->modelNames = $this->controller->modelNames;
$this->name = $this->controller->name;
$this->pageTitle = $this->controller->pageTitle;
$this->viewPath = $this->controller->viewPath;
$this->params = $this->controller->params;
$this->data = $this->controller->data;
$this->webservices = $this->controller->webservices;
$this->plugin = $this->controller->plugin;
if(is_object($controller)){
$this->controller =& $controller;
$this->_viewVars = $this->controller->_viewVars;
$this->action = $this->controller->action;
$this->autoLayout = $this->controller->autoLayout;
$this->autoRender = $this->controller->autoRender;
$this->base = $this->controller->base;
$this->webroot = $this->controller->webroot;
$this->helpers = $this->controller->helpers;
$this->here = $this->controller->here;
$this->layout = $this->controller->layout;
$this->modelNames = $this->controller->modelNames;
$this->name = $this->controller->name;
$this->pageTitle = $this->controller->pageTitle;
$this->viewPath = $this->controller->viewPath;
$this->params = $this->controller->params;
$this->data = $this->controller->data;
$this->webservices = $this->controller->webservices;
$this->plugin = $this->controller->plugin;
}
parent::__construct();
}