I’m trying to set urlManager rules at runtime with the following code in my controller:
$components=array( 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName' => false, 'rules'=>array( '/contact'=>'/site/contact', ), ), ); Yii::app()->setComponents($components);
Somehow this doesn’t work. What am I doing wrong?
Is there another way to set configuration at runtime?
Thanks in advance!