在Yii crud中,我根据名为Form的db表设置了Model,View和Controller。 到目前为止,我已根据自己的喜好修改了控制器和视图:
index.php/form/all (index) index.php/form/new (create) index.php/form/2 (view) index.php/form/2/edit (edit) index.php/form/2/delete (delete)现在我想设置一些动态的子页面。 网址模式如下。 如何在FormController.php中设置它?
index.php/form/2/fields/all index.php/form/2/fields/new index.php/form/2/fields/1/edit index.php/form/2/fields/1/deleteBTW - Fields是一个单独的数据库表,具有单独的yii模型。 虽然如果我不需要,我想不为它创建一个控制器。
In Yii crud, I've setup a Model, View, and Controller based on my db table called Form. I've modified the controller and views to my liking thus far:
index.php/form/all (index) index.php/form/new (create) index.php/form/2 (view) index.php/form/2/edit (edit) index.php/form/2/delete (delete)Now I'd like to setup some subpages that will be dynamic. The url patterns are below. How do I set this up inside of the FormController.php?
index.php/form/2/fields/all index.php/form/2/fields/new index.php/form/2/fields/1/edit index.php/form/2/fields/1/deleteBTW - Fields is a separate db table with a separate yii model. Though I'd like to not create a controller for it if I don't need to.
最满意答案
谢谢Neophile,我最后添加了一个字段控制器。 这是我完成的解决方案的链接: Yii用于多个控制器操作参数的URLManager规则
Thanks Neophile, I ended up adding a fields controller. Here is a link to my finished solution: Yii URLManager rule for multiple controller action parameters
更多推荐
发布评论