Question regarding URL with several parameters


I have one question, maybe you can help me out.

I want the following Url


To be taken care of by mycontroller/view

So I have the following in urlManager and I was hoping that the first rule would take care of it:











But I keep getting: The system is unable to find the requested action "whatever-it-the-id-is"

What I am doing wrong ?



Very interesting!

I just try your example and found one really weird solution.

There’s only one allowed separator character that you can use for $_GET params:


Believe me or not this will work:

<?php echo CHtml::link('test', array('site/contact', 'id' => 'some_id_param', 'gid' => 'some_gid_param')); ?>

// urlManager rules


'site/<id:\w+>/<gid:\w+>' => 'site/contact',


But this won’t:

<?php echo CHtml::link('test', array('site/contact', 'id' => 'some-id-param', 'gid' => 'some-gid-param')); ?>

Try it!

That worked, I feel so dumb, I didn’t remember that \w didn’t support - and this what was causing problems.

Thanks a lot :D

Case closed …