简体   繁体   English

Zend框架中的“子控制器”

[英]“Sub Controllers” in Zend Framework

I am developing an application with the Zend Frameworks. 我正在使用Zend框架开发应用程序。

I currently have the Controller admin, which has its appropriate actions 我目前有Controller管理员,它有相应的操作

I have the action "Users", and and I would like to be able to make this its own controller, so all the relevant actions are under their own class 我有动作“ Users”,并且我希望能够使其成为自己的控制器,所以所有相关动作都在自己的类下

Admin {
    Users {
        Add
        Delete
        Import
    }
}

Restructure your code using modules. 使用模块重组代码。 Admin should become a module . Admin应该成为一个模块 Inside the Admin module you should have the controller Users. 在管理模块内部,您应具有控制器用户。 This controller has the actions add, delete and import. 该控制器具有添加,删除和导入操作。

我认为您真正需要的是动作帮助器,因为添加/删除/导入“动作”或多或少是无处不在的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM