mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Themed CakeEmail should load view helpers with the theme set
This commit is contained in:
parent
d559e429e6
commit
d55a167830
3 changed files with 8 additions and 3 deletions
|
@ -1623,6 +1623,11 @@ class CakeEmail {
|
|||
$View = new $viewClass(null);
|
||||
$View->viewVars = $this->_viewVars;
|
||||
$View->helpers = $this->_helpers;
|
||||
|
||||
if ($this->_theme) {
|
||||
$View->theme = $this->_theme;
|
||||
}
|
||||
|
||||
$View->loadHelpers();
|
||||
|
||||
list($templatePlugin, $template) = pluginSplit($this->_template);
|
||||
|
@ -1632,9 +1637,7 @@ class CakeEmail {
|
|||
} elseif ($layoutPlugin) {
|
||||
$View->plugin = $layoutPlugin;
|
||||
}
|
||||
if ($this->_theme) {
|
||||
$View->theme = $this->_theme;
|
||||
}
|
||||
|
||||
// Convert null to false, as View needs false to disable
|
||||
// the layout.
|
||||
if ($layout === null) {
|
||||
|
|
|
@ -1337,6 +1337,7 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$this->assertContains('In TestTheme', $result['message']);
|
||||
$this->assertContains('Message-ID: ', $result['headers']);
|
||||
$this->assertContains('To: ', $result['headers']);
|
||||
$this->assertContains('/theme/TestTheme/img/test.jpg', $result['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
In TestTheme
|
||||
<?php echo $this->Html->image('test.jpg') ?>
|
Loading…
Reference in a new issue