Zend Framework:设置默认响应部分

发布于 2024-07-27 15:17:34 字数 234 浏览 5 评论 0原文

我不是 100% 确定如何表达这个问题,所以如果可以的话请帮助我。

我有一个带有可以安装的模块的系统。 我检查每个模块是否有一个 MenuController,如果有,我将一个操作推入堆栈。 问题在于,在每个 MenuController 中,如果我不使用 $this->render('index.phtml', 'menu'); 然后输出进入身体。 有什么方法可以指定菜单控制器的输出默认进入“菜单”部分吗?

I'm not 100% sure how to phrase this question so please help me if you can.

I have a system with modules that can be installed. I check if each module has a MenuController and if so I push an action onto the stack. The problem becomes that in each MenuController, if I don't use $this->render('index.phtml', 'menu'); then the output goes into the body. Is there some way that I can specify that the output for the menu controllers should go into the 'menu' section by default?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

愿与i 2024-08-03 15:17:34

在 MenuController 中使用 $this->_helper->viewrenderer->setResponseSegment('sth'); 在 preDispatch() :)

in MenuController use $this->_helper->viewrenderer->setResponseSegment('sth'); in preDispatch() :)

慢慢从新开始 2024-08-03 15:17:34

我最终只是扩展了 Zend_Controller_Request_Http 并添加了 DefaultName() 的方法。

I ended up just extending Zend_Controller_Request_Http and adding methods for DefaultName().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文