E
E
EVOSandru62015-05-26 03:50:52
Yii
EVOSandru6, 2015-05-26 03:50:52

How to generate url with id at the end in Yii?

Hello,
Why is this code:

Yii::app()->createUrl('/product/item', array('id', $item->CODE))

Generates the following url :
wesite/product/item?0=id&1=25
Here is my configuration:
'rules'=>array(
        '<action:(login|logout)>' => 'user/<action>',
        '<action:(contact)>' => 'site/<action>',
        '<controller:\w+>/<id:\d+>'=>'<controller>/view',
        '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
        '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
        '<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>/<id>',
        '<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>',
    ),

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Malinin, 2015-05-26
@EVOSandru6

I think it should be like this:
I can be wrong

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question