Closes #3429, scripts_for_layout are lost when you send an email with EmailComponent

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5874 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-10-22 23:52:12 +00:00
parent beb600094b
commit 56425c7f39
2 changed files with 5 additions and 3 deletions

View file

@ -362,7 +362,7 @@ class EmailComponent extends Object{
$viewClass = $viewClass . 'View';
loadView($this->Controller->view);
}
$View = new $viewClass($this->Controller);
$View = new $viewClass($this->Controller, false);
$View->layout = $this->layout;
$msg = null;

View file

@ -262,7 +262,7 @@ class View extends Object {
*
* @return View
*/
function __construct(&$controller) {
function __construct(&$controller, $register = true) {
if (is_object($controller)) {
$count = count($this->__passedVars);
for ($j = 0; $j < $count; $j++) {
@ -278,8 +278,10 @@ class View extends Object {
);
}
parent::__construct();
if($register) {
ClassRegistry::addObject('view', $this);
}
}
/**
* Renders view for given action and layout. If $file is given, that is used