url - How to handle GET params within urlManager's rule in Yii? -


i pass query string searchcontroller::actiondefault in form of get parameter q:

/search/?q=...

however need define rule automatically initialize parameter value or define param.

if i'll request mysite.com/showall need same content in /search/?q=*

this i've tried:

'/showall' => '/search/default/index/?r=*',

i solved this!

there possible set defaultparams in urlmanager, , finaly looks in application config file:

 ... 'components' => array(     ...      'urlmanager' => array(         ...         'rules' => array(             ....             '/show_all' => array( '/search/default/index', 'defaultparams' => array('show_all'=>'-') ),             ....         ),         ...     ),     ... ), 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -