E
E
EVOSandru62015-03-31 03:31:18
Yii
EVOSandru6, 2015-03-31 03:31:18

How in yii in the rules of the config to make sure that the id is set in the link?

Good afternoon,
There is such a rule in the rules:

'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

There is a link in the menu:
... 
'url' => Yii::app()->createUrl('/product/all',array('id'=>1))
...

But for some reason instead of:
/product/all/id/1
Formed:
/product/all/1
Although alias is eaten
What is the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bay, 2015-03-31
@EVOSandru6

Remove the rule completely, and you will have a link /product/all/id/1 .
With your rule, /product(controller)/all(action)/1(id) is generated, which matches the rule
'//' - controller/action/ id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question