Created
December 17, 2013 20:37
-
-
Save jawinn/8012196 to your computer and use it in GitHub Desktop.
Yii urlManager Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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', | |
), | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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