golddiga
(Mike Peuerboeck)
February 8, 2013, 3:23pm
1
hi, acutally I didnt find a answer on my question in the forum so I decided to start a new topic.
We are going to split our application into modules and face some problems with that. First of all it was no problem to get the controllers / views and models to the right place and with the correct routing everything works fine
what we do in the Url Manger is f.e.
‘controller/action’ => ‘module/controller/action’,
but if we generate a Link with CHtml::normalizeUrl() the build link doesnt have the correct structure
CHtml::normalizeUrl(array(
'controller/action',
'id'=>$this->id,
));
OUTPUT:
mydomain/module/controller/action/id
we would need
mydomain/controller/action/id
is there any way to solve this
thanks in advance for any hint
rootbear
(Alex Xm)
February 8, 2013, 5:33pm
2
OK, (I thought about hiding module name while ago), you may have to hardcode url rules for your module/controller
like this:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
//~~~
'ctrleraaa/<action:\w+>'=>'/module_aaa/ctrleraaa/<action>',
'ctrlerbbb/<action:\w+>'=>'/module_aaa/ctrlerbbb/<action>',
//~~~
),
),
tri
(tri - Tommy Riboe)
February 8, 2013, 10:09pm
3
/* moved to General Discussion */
(not a tip, snippet or tutorial)
golddiga
(Mike Peuerboeck)
February 11, 2013, 7:49am
4
rootbear:
OK, (I thought about hiding module name while ago), you may have to hardcode url rules for your module/controller
like this:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
//~~~
'ctrleraaa/<action:\w+>'=>'/module_aaa/ctrleraaa/<action>',
'ctrlerbbb/<action:\w+>'=>'/module_aaa/ctrlerbbb/<action>',
//~~~
),
),
Thanks a lot for your reply. Actually I hoped there would be a nice way.
regards