集成 Zend Controller 独立版 - 无需 Zend Framework 的其余部分
我在我的应用程序中使用 Zend Framework 的特定部分,并且我想用 Zend Framework 控制器替换我的自制控制器。
我的自制控制器基于一个index.php 文件,所有请求都提交到该文件。根据请求中发送的参数实例化控制器
处理后,用户将转发到基于请求信息的 url,指定 url 或分析一些数据
我想了解如何将 Zend 控制器集成到我的应用程序中 更新
提前感谢
:我愿意导入其余的依赖项,事实上我已经有了配置、异常、注册表、URI 和视图。但是,我不想将布局更改为 Zend 应用程序布局。看来我可能需要使用 FrontController 但我似乎找不到任何例子
I am using specific parts of the Zend Framework in my application, and I would like to replace my home grown controller with a Zend Framework controller.
My home grown controller is based on an index.php file to which all requests are submitted. A controller is instantiated based on parameters sent within the request
After processing the user is forwarded to url which is based on the request information, either a url is specified or some data is analysed
I would like ideas on how to integrate the Zend Controller within my application
Thanks in advance
Update: I am willing to import the rest of the dependencies, infact I already have Config, Exception, Registry, URI and View. However, I do not want to change my layout to the Zend Application layout. It seems that I may need to use the FrontController but I cannot seem to find any examples
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,如果您生成默认的 Zend Framework 项目,它将没有任何布局。如果是这样,只需在
config.ini
或Bootstrap.php
中注释或删除resources.layout.*
Zend_Layout 是复合视图 模式,基本上意味着它充当其他视图的包装器。
您可以通过运行默认的 Zend Framework 应用程序并删除布局以仅使用视图来解决问题。
请注意,您仍然可以使用仅包含
layout()->content; 的布局。 ?>
By default, if you generate a default Zend Framework project, it won't have any layout. If it does, just comment or remove
resources.layout.*
in yourconfig.ini
or in theBootstrap.php
Zend_Layout is part of the Composite View Pattern which basically means it acts as a wrapper for the other views.
You should be fine by running a default Zend Framework application and remove the layout to only use the view.
Note, that you can still use a layout with only
<?= $this->layout()->content; ?>