which does not redirect to controller/action as it should (it will just load the site index).
If it were just a matter of creating a single url i could use createPathInfo but the issue is when you are using CGridView for example it would be nice to have an easy way to have pagination and the likes switch to "get" rather than "path" format.
Well the problem here is that a dynamic form is used to run a search on content. This form sends the data as GET, and slashes are allowed (in say, searching dates). I do not know beforehand how many fields are going to be sent or which ones they are, but I do have to handle slashes in params.
Obviously this is an issue with ‘path’ format urls, but If I want to switch to ‘get’ format urls for this request as well as all pager links (in cgrid and clist), but keep path format for the rest of the site, I hit a bit of a wall.
I was wondering if there was anyway to switch from one to the other on demand. Just setting the urlManager->urlFormat to “get” dynamically gives me an url when I createUrl() that isn’t interpreted correctly by Yii on the other end.
echo $this->createUrl('controller/action',array('paramName'=>'param/value')); // working url of /controller/action/paramName/param%2Fvalue
// but as mentioned above, Yii treats %2F as a slash so my GET is corrupt
Yii::app()->urlManager->urlFormat = 'get'; //or Yii::app()->urlManager->setUrlFormat('get');
Yii::app()->urlManager->showScriptName = true;
echo $this->createUrl('controller/action',array('paramName'=>'param/value')); //non-working ?r=controller/action¶mName=param%2Fvalue
// Yii doesn't seem to care for non-path URLs because of main.php config
Do you guys see any easy solution for this? a ‘get’ url that would work would be /controller/action?paramName=param%2FValue but the URL manager does not create urls like this oddly. I was hoping we could get another urlFormat. Is there a way of setting up a custom one? I could then hopefully configure the pager’s urlmanager options.