4

Currently view scripts located in APPLICATION_PATH . '/modules/my_module/views/scripts/'. I want to place scripts in '/modules/my_module/views/' (remove scripts folder). How to achieve this?

application.ini:

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

3 Answers 3

5

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...

Sign up to request clarification or add additional context in comments.

Comments

1

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');

Comments

0

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/"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.