为什么没有 Zend_Layout 帮助器或代码隐藏?以及最好的方法

发布于 2024-12-27 07:51:40 字数 188 浏览 1 评论 0原文

我只是想知道为什么没有代码隐藏或助手来处理布局?我有一些想要在布局中显示的内容,而不必在每个控制器的占位符中设置它。

我还想知道在多个页面上持久显示一次“成功消息”的最佳方法是什么。例如,用户填写表单,正确提交后,他们将被重定向到另一个页面。我希望用户在其他页面上看到成功消息。 Zend Framework 中是否有某种规定可以使这变得更容易?

I was just wondering why no code-behind or helpers were made to work with layouts? I have stuff I want to display in my layouts without having to set it up in a placeholder for every single controller.

I was also wanted to know what is the best way to persist a display-once "success-message" across many pages. For example, a user fills out a form and when it is submitted correctly they are redirected to another page. I want the user to see a success message on that other page. Is there some sort of provision in Zend Framework that makes this easier?

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

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

发布评论

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

评论(1

似狗非友 2025-01-03 07:51:40

对于消息,您可以使用 Flash Messenger helper

至于设置占位符,您可以使用基本控制器并在必要时覆盖后代的 init 方法中设置它们。

Well for the messages you can use the Flash Messenger helper

As far as setting up the place holders you could use a base controller and set these up in the init method overriding on descendents when necessary.

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