Composite Primary Key and UrlManager

Hi there,

It seems that my yii does not like composite primary keys in models.

I use an array of strings for my composite primary keys as explained in doc, but I have a 400 error (that’s an urlmanager error right?)

I use it with GridView, CButtonColumn and an url issue update like :




So, my buttons links look like :


(understand that ‘<’ chars are ‘generic’ and not present in the url).

I use no UrlManager ‘override’ in the main.php (so I use default features).

Could you help me?

Many thanks

Parameter names in your view/update/delete action method must match the names of GET parameters.

Gii (if used) generates something like this:

public function actionView($id) {...}

It has to be changed to:

public function actionView($id_1, $id_2) {...}

Thank you for your answer.

Could you please tell me how can I show data with composite primary key in CGridView ???

Helps highly appriciate

I just wrote this little piece of info today. May be of assistance. I know it is an old question though… sorry.