Skip to content

Instantly share code, notes, and snippets.

@jawinn
Created December 17, 2013 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jawinn/8012196 to your computer and use it in GitHub Desktop.
Save jawinn/8012196 to your computer and use it in GitHub Desktop.
Yii urlManager Example
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName' => false,
'rules'=>array(
// custom rules go first
'product/<slug:[a-zA-Z0-9-]+>/'=>'product/view',
// default controller url setup
'<controller:w+>/<id:d+>'=>'<controller>/view',
'<controller:w+>/<action:w+>/<id:d+>'=>'<controller>/<action>',
'<controller:w+>/<action:w+>'=>'<controller>/<action>',
// defaults to a site page if not above
'<view:[a-zA-Z0-9-]+>/'=>'site/page',
),
),
@rahulsinh
Copy link

I have program controller with different action
when using this code for url manager then it working good for site controller but not for program controller for example:for site controller
http://local.advance.com/frontend/web/site/about

for program controller
http://local.advance.com/frontend/web/index.php?r=programs%2Findex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment