开发者

Change Zend Framework module view script path

Currently view scripts located in APPLICATION_PATH . '/modules/my_module/views/scripts/'. I want to place scripts in '/modules/my_module/vie开发者_运维知识库ws/' (remove scripts folder). How to achieve this?

application.ini:

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] =
resources.view.scriptPath.default = APPLICATION_PATH "/views"


You could use the setScriptPath(APPLICATION_PATH . '/modules/my_module/views') view method to replace the script path.

You can also add your script path without overriding the previous one, using addScriptPath(APPLICATION_PATH . '/modules/my_module/views'). I use it to have organized the view scripts in different folders.

Hope that helps...


if you want change view script for any action
inside your controller action add this:

$this->view->addScriptPath(APPLICATION_PATH . 'your/path');
$this->renderScript('list.phtml');


I know this is pretty old but it may help someone. I had this same problem. I achieved this by using

resources.view.scriptPath = APPLICATION_PATH "/views/"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜