Changes
Title
unchanged
An important tip when you are using CArrayDataProvider.
Category
unchanged
Tips
Yii version
unchanged
Tags
unchanged
CArrayDataProvider
Content
changed
Yii
â's CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named âidâ as primary key for its pagination purpose and what if you dont have field named âidâ as primary key on your table? so its truely confusing and if you tried to display without an âidâ field on ur table you will get an error like âyourmodel.id is not definedâ.
To solve this CArrayDataProvider confusing problem you just need to use on of its attribute named âkeyFieldâ to specify your primary key field on your table.There is an property named âidâ thats just an id of the dataProvider itself.[...]
Regards,
sirinsirin k
[Yii developer](http://www.nintriva.com "Yii developer")