Add Criteria To Crud Generated Page

Hello every body,

I’m new on Yii, and I didn’t find any tutorial or trick for the following problem:

I would like my CRUD generated page to be dependent of my logged user.

More precisely, I would like to add a criteria (userid="") to the request getting the list of my data in the CRUD page.

It doesn’t seem to be difficult, but I didn’t find the good tutorial which explain how the CRUD page are generated.

So if someone can give me a trick or a link on the appropriate tutorial…

Thanks a lot

Hi davgut, welcome to the forum.

There’s no “trick” at all in Yii. :)

I would like to recommend you to read this wiki article:

http://www.yiiframework.com/wiki/381/cgridview-clistview-and-cactivedataprovider

It will explain how the CRUD pages (especially "admin" page) are constructed.

And you may easily add a condition to filter the result by user id.