This is about setting WebRoot/protected/config/main.php *urlManager* on Yii Framework.
I want a few predefined url like /About
/Contact
or some other custom special page like /LatestUpdates
or /HTCDesire
I can do 'Contact'=>'site/contact' to map /Contact to /site/contact
How can I 'hard code' query string to the route?
I try:
'About'=>'site/page?view=about'
'LatestUpdates'=>'update/view?id=65'
'HTCDesire'=>'product/view?id=33'
but not working, 404 not found because it expect the right side should be route in format controller/action.
I try:
'LatestUpdates'=>'update/view/id/65'
I can browse to /LatestUpdates
but the anchor link still shows /update/view/id/65
Is there any other way?
This works for me (except I substituted your values in, so maybe I broke it...):
'LatestUpdates'=>array('update/view','defaultParams'=>array('id'=>'65')),
More about this here and here.
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With