p30tec
(Sellthemeiran)
1
Hi
This is a part of view code for zii.widgets.CMenu widget that set URL of link
array('/site/page', 'view'=>'about')
When I set config as
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'appendParams'=>true
),
I have this link
but when I define rules such as
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
the link convert to
I cannot define all rules because we have many params
I want always force append Params in each rules
How can I do this??
Keith
(Kburton)
2
For this case, I would define a special rule before your others. Untested, but it could look something like this:
'<view:(about|other|specific|pages|here)>'=>'site/page',
Then, your URLs will look like this:
http://mysite.com/about
and they should be routed to the correct controller and action.
The only downside is that you need to include each of those static views in the pattern above.
p30tec
(Sellthemeiran)
3
As I told before , I have many params and I cannot define many rules
When I set config as
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'appendParams'=>true
),
appendParams works well but when I define my rules appendParams dont works , I want just define critical rules and always force appendParams works
I want always appendParams in links , like http://mysite.com/site/page/view/about without defining many more rules
Keith
(Kburton)
4
The API for CUrlManager states:
So you need to add /* to the end of the relevant rules.
p30tec
(Sellthemeiran)
5
Thanks Keith and thanks /* 