为什么没有 Zend_Layout 帮助器或代码隐藏?以及最好的方法
我只是想知道为什么没有代码隐藏或助手来处理布局?我有一些想要在布局中显示的内容,而不必在每个控制器的占位符中设置它。
我还想知道在多个页面上持久显示一次“成功消息”的最佳方法是什么。例如,用户填写表单,正确提交后,他们将被重定向到另一个页面。我希望用户在其他页面上看到成功消息。 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于消息,您可以使用 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.