Is it necessary to have a view file with every controller action

后端 未结 2 1349
名媛妹妹
名媛妹妹 2021-01-24 20:03

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 acti

2条回答
  •  走了就别回头了
    2021-01-24 20:24

    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 rendered

    2- You can simply do what you need to do and call exit() in the end of the of your action.

    Hope it helps.

    Cheers

提交回复
热议问题