3

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!

somejkuser
  • 8,856
  • 20
  • 64
  • 130

1 Answers1

4

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.

drew010
  • 68,777
  • 11
  • 134
  • 162