mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Ensure helpers are loaded in data views.
Both XmlView and JsonView should load helpers when they use view files. Fixes #2465
This commit is contained in:
parent
7877e7f997
commit
0f8e1500de
2 changed files with 6 additions and 0 deletions
|
@ -96,6 +96,9 @@ class JsonView extends View {
|
|||
return $content;
|
||||
}
|
||||
if ($view !== false && $viewFileName = $this->_getViewFileName($view)) {
|
||||
if (!$this->_helpersLoaded) {
|
||||
$this->loadHelpers();
|
||||
}
|
||||
$content = $this->_render($viewFileName);
|
||||
$this->Blocks->set('content', $content);
|
||||
return $content;
|
||||
|
|
|
@ -99,6 +99,9 @@ class XmlView extends View {
|
|||
return $content;
|
||||
}
|
||||
if ($view !== false && $viewFileName = $this->_getViewFileName($view)) {
|
||||
if (!$this->_helpersLoaded) {
|
||||
$this->loadHelpers();
|
||||
}
|
||||
$content = $this->_render($viewFileName);
|
||||
$this->Blocks->set('content', (string)$content);
|
||||
return $content;
|
||||
|
|
Loading…
Reference in a new issue