I'm using the CHtml::link()
function, and I have a problem with the index action.
The code in view:
echo CHtml::link('Watch it', array('video/index', 'id' => $id));
The urlManager part in config:
'urlManager' => array(
'urlFormat' => 'path',
'rules' => array(
'<id>/<action>' => 'video/<action>',
'<id>' => 'video/index'
)
)
What I want it to do is to create a link to:
http://localhost/123
Instead, it creates a link to:
http://localhost/123/index
How can I remove the '/index' part?
Creating a function that will handle this (replace '/index' with nothing) will be the best solution for this?