ovidiu
(Guvi77)
February 4, 2011, 4:26pm
1
Hi,
Can anyone tell me if I can use a module as module but in the same time as submodule of a module?
Ex: Let’s say I have a site with 2 modules: admin and news.
Using as module for frontend: /index.php?r=news => display the news with front-end layout
Using as submodule for backend operations: /index.php?r=admin/news => display the news with back-end layout (for editing and stuff).
The main reason is to keep all logic about backend and frontend of the module news is one place.
How can i generate the CRUD inside the module with the gii ?
Thanks.
samdark
(Alexander Makarov)
February 4, 2011, 4:29pm
2
If you don’t really want two modules, why not just change URLs?
gusnips
(Gustavo)
February 4, 2011, 4:29pm
3
yes, you can
i’ve also created a modified version of gii module creator to support nested modules and can be found here
to set it up do the following:
'modules'=>array(
'admin'=>array(
'modules'=>array(
'news'
)
)
)
to create crud inside just define the controller name like : ‘admin/news/myController’
ovidiu
(Guvi77)
February 4, 2011, 4:58pm
5
Because depending how the module is accessed i can filter some operation: if is accessed as submodule it means someone accessed the backend area and allow user to edit the article, othewise i don’t allow him.
The ideea is to have a single compact module news, and in the same time to create different url for backend and frontend area.