I have enabled "beautiful urls" by configuring the CUrlManager like this:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'browserconfig.xml'=>'microsoft/browserconfig',
''=>'',
),
),
Unfortunately I have quite some issues with filtering since I enabled it, and I now analysed why.
Basically, after applying a few filter updates, the url generated by CGridView looks like this:
http://www.example.com/controller/action/param1/valueA?param1=valueB
The "GET" parameter having "valueB" is the most recently requested filter.
Unfortunately, the CUrlManager will decode the ‘param/valueA’ part and applies ‘valueA’ to param1.
So, IMHO this is not the right behavior: the actual GET values should have precedence over the values encoded in the path. So I think that the algorithm should be to convert the path "parameters" to an array and "merge" the actual $_GET value with it so that the provided $_GET values have precedence.
The CUrlManager does the following for the default parameters (i.e., it test if the $_GET value exists); something similar in spirit should be applied to the path parameters.
foreach($this->defaultParams as $name=>$value)
{
if(!isset($_GET[$name]))
$_REQUEST[$name]=$_GET[$name]=$value;
}
I looked if other people had the same issue and I found a report dating back to 2010:
https://code.google.com/p/yii/issues/detail?id=1325
Unfortunately that is a “Wont-fix”, but I do not understand the rational compared to my use. I have no ‘*’, so I can not remove it.
I’ld think that if the CUrlManager breaks the CGridView filterering, that this is something abnormal in the framework.