weixin_39999209
2020-11-25 19:16Nested Routes
Nested routes are a possible way so solve the problem that we have with button actions. A listing of items of type A
would be handled by controller for entity A
and not through show_list
of entity B
.
In controller for entity C
that is using the GenericShowMixin
we already have display_methods
that give the list of entities that we display through nested_list
and that is what we need as nested routes below the C
. So this can be used to get the list of routes that need to be defined.
The initial work should be done on controller that already use the "generic" mixins and as we refactor more controller we should convert them to use the nested routes.
For example route host/10/instance/5
would be handled by instance_controller
. It would display toolbar for instances and there would be no problem with handling the button actions.
Generally all show
and show_list
would be handled by controller for the entity that is being shown. Unlike now.
Ping
该提问来源于开源项目:ManageIQ/manageiq
- 点赞
- 回答
- 收藏
- 复制链接分享
9条回答
为你推荐
- 类别树的路由
- symfony
- php
- 2个回答
- Laravel 4中的嵌套控制器
- laravel
- php
- 2个回答
- 添加到嵌套数组
- arrays
- php
- 1个回答
- Laravel嵌套关系foreach循环
- nested
- laravel
- relationship
- php
- 2个回答
- Yii:为什么我的控制器默认索引不起作用?
- yii
- php
- 3个回答