In my Yii application I defined rules in Yii’s urlManager as follows:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'izletiste/<grad:\.*?>/<naziv:.*?>/<id:d+>'=>'izletiste/show',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
Now, when I want to create a link, I use the following construction:
<?php echo CHtml::link("Link text",array("izletiste/show","grad"=>"Paris","naziv"=>"Some text", "id"=>$id)); ?>
The url I get is the following:
mywebsite.com/izletiste/Paris/Some+text/21
But when I click on the link, I get the following error:
My question is why is that happening, why Yii doesn’t recognize that izletiste/show action should be called instead izletiste/paris, and how to fix this?