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:
mark_story 2012-01-11 20:21:56 -05:00
parent 7877e7f997
commit 0f8e1500de
2 changed files with 6 additions and 0 deletions

View file

@ -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;

View file

@ -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;