我刚刚发现我的操作可以使用相同的 View ,只是更改一些参数。
因此,当/controller/ 加载'path/to/scripts/controller/index.phtml' 时,我想要 controller/action1 加载 'path/to/scripts/controller/index.phtml' 而不是加载 'path/to/scripts/controller/action1.phtml',默认情况下。哪种方法最干净?
最佳答案
您可以在同一 Controller 的action1 中执行此操作:
$this->_helper->viewRenderer('index');
关于php - 更改默认 View zend 框架行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7948647/