Zend view script path setup

Here is the code I have:

$this->getView()->setScriptPath($templatePath);
$this->_helper->viewRenderer($page);

This code is processed in an action of the form Core_PageController. The problem that I see now is that the view object is looking for my script files in $templatePath/page, since the page is the controller. I would like the view object to look only at the directory path $templatePath(without the page directory);

Thanks for the help!

+3
source share
1 answer

You can choose ViewRenderernot to use the controller name as part of the script presentation path.

To do this, try:

$this->_helper
     ->viewRenderer
     ->setNoController(true); // do not use controller name as part of the view path

setNoController ($ flag = true) , render() script , ( ). getNoController() .

ViewRenderer.

+4

All Articles