Right now the view scripts for my Zend Framework application are located in the application/views/scripts directory. Is it possible to change this location to something that is configurable?
I am assuming this goes somewhere in the index.php
file or my application.ini
file.
For convenience ZF automatically sets the view script path to be module/views/scripts/controller/action.phtml
You can add a script path via $view->addScriptPath('/path/to/view/scripts')
which adds this new path to the stack of available view script paths. It checks the last one set first, then checks on the one before until it finds a file.
Or you can reset the script path via $view->setScriptPath('/path/to/view/scripts')
If you need to do this for a controller place this in your _init() method. If you need it for your entire application I'd recommend sticking it in your Bootstrap.
I believe it's also possible to place this in application.ini via: resources.view.basePath = "/path/to/views/"
See http://framework.zend.com/manual/en/zend.view.controllers.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With