Hey.
I’m wondering if there is a Yii way to change(or add) a param in the url accoring to defined set of route rules.
Speaking about my case:
I have an url: http://example.com/en/project/create (and this might also be http://example.com/project/create)
I need to change(or add) language to the url to make it like http://example.com/de/project/create.
This is not working for me:
$this->createUrl($_SERVER['HTTP_REFERER'], array('lang'=>$_GET['newlang']))
where my route rules are:
'rules' => array(
'<lang:('.$lang_rule.')>' => '',
'<lang:('.$lang_rule.')>/<_c>' => '<_c>',
'<lang:('.$lang_rule.')>/<_c>/<_a>/' => '<_c>/<_a>',
'<lang:('.$lang_rule.')>/<_m>/<_c>/<_a>' => '<_m>/<_c>/<_a>',
),
// $lang_rule is a string like 'en|de'
p.s. Yes, I know how to do this in plain PHP in million ways, but I’m trying to find if this is possible with Yii.
Thanks