Permalink
Browse files

Ensure helpers are loaded in data views.

Both XmlView and JsonView should load helpers when
they use view files.

Fixes #2465
  • Loading branch information...
1 parent 7877e7f commit 0f8e1500deee08a5a923ec30f680a822650166f7 @markstory markstory committed Jan 12, 2012
Showing with 6 additions and 0 deletions.
  1. +3 −0 lib/Cake/View/JsonView.php
  2. +3 −0 lib/Cake/View/XmlView.php
@@ -96,6 +96,9 @@ public function render($view = null, $layout = null) {
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 @@ public function render($view = null, $layout = null) {
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;

0 comments on commit 0f8e150

Please sign in to comment.