Issue
i have in YII for example domain: www.example.com/product-url-1234
how to set rules in urlManager and how to use controller/action/id
Solution
If you want to use this url www.example.eu/product-url-1234
and suppose 'index'
is the name of the action of the 'user'
controller that will handle the request
Then create a rule like
'<id:.*?>'=>'user/index'
Now if you will use Yii::app()->createUrl('user/index',array('id'=>'product-url-1234'))
then it will give you the desired result.
And if you Visit this Url, User/Index
will handle the request.
Answered By - Let me see
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.