I want to use a CListView, I have created my CActiveDataProvider, but I cannot limit the number of records, the property ‘limit’ just doesn’t work here, I have checked this in the wiki.
In order to get this work, I haven’t used CListView, just CActiveRecord and foreach bucle, but I’m curious to know if there is a way to limit in CActiveDataProvider.
//When you create your CActiveDataprovider:
$dataProvider=new CActiveDataProvider('table', array(
'pagination'=>array(
'pageSize'=>8,
),
));
//When you use CListView, add this property:
'template'=>"{items}",
The pager won’t be displayed, but now my doubt is… When we create the CActiveDataProvider, is it getting every single record of the table??? I mean… It won’t be so effective for the DB in case you have a lot of records in that table. Any opinion?