Hi,
I am trying to create link like this
CHtml::link("Just link", array("monitor/sava")
and my main.php
'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>',
'home'=>'site/index',
'monitor/<username:\w+>' => 'monitor/view',
),
),
I have already create actionView in my monitorController
public function actionView($username)
{
//something
}
and get this error
any idea?
thanks!
McQueen
(Mail)
2
Because, first part of the url is controller name and second part is action name.
So you have to create a new function like;
public function actionSava($username){ blabla... }
McQueen, Thank you for you reply
But I dont think that, because I have already URL rule that any
request with monitor/<word> redirect to monitor/view/username/<word>
or did I understand something wrong??
'monitor/<username:\w+>' => 'monitor/view',
McQueen
(Mail)
4
Oh ok. i didnt see it. So put it to top of the rule and try again.
It works!!!
Thank you for your advice.