Whenever I create a new action in the zend framework controller using the zf CLI tool it creates the corresponding view file. However, I don't need the view file for every action in the controller.
If I delete that view file manually will it affect my project.xml file or have any other effect on my project ?
No you don't need to.
Been a while since i worked with Zend Framework. But if memory serves me well, you have two options here.
1 -
$this->_helper->viewRenderer->setNoRender(true);
Which will stop the view being rendered2- You can simply do what you need to do and call
exit()
in the end of the of your action.Hope it helps.
Cheers
If your action does not require a view then you can disable it:-
If you want to disable the view/layout for the whole controller then you can put the lines above in the
init()
method of your controller like this:-Once you have done that you can safely delete the view files without affecting anything else.
More details are available in the Action Controller manual.