Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend view script path setup

Here is the code I have:

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

This code is handled in the Core_PageController view action. The problem I have is now the view object looks for my script files in $templatePath/page since page is the controller. What I'd like is for the view object to look in just the $templatePath directory path (without the page directory);

Thanks for the help!

like image 724
somejkuser Avatar asked Mar 04 '26 10:03

somejkuser


1 Answers

You can instruct the ViewRenderer to not use the controller name as part of the view script path.

To do that, try:

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

setNoController($flag = true) can be used to tell render() not to look for the action script in a subdirectory named after the controller (which is the default behaviour). getNoController() retrieves the current value.

More info on the ViewRenderer helper.

like image 117
drew010 Avatar answered Mar 07 '26 06:03

drew010



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!