CListView property enablePagination bug


well it’s late down here but i think this behavior is not just strange but completly unintentional.

In CListView you’re able to hide the Pagination by setting the property ‘enablePagination’ to false. But it doesn’t disable the pagination it just hides it.

If you have configured the DataProvider with a pagination object the paginations properties are still applied to the query.

I did the following using the blog demo app / yii v.1.1.3-dev.

In PostController.php - actionIndex()

$dataProvider=new CActiveDataProvider('Post', array(






and in posts index view (post/index.php):

<?php $this->widget('zii.widgets.CListView', array(





)); ?>

This results in not seeing a pagination but always seeing only one post, because pagesize=>1 is still applied.

The only way to really disable the pagination is to explicitly set ‘pagination’=>false for CActiveDataProvider.

If this is a wanted behavior ‘enablePagination’ isn’t intuitive and should be called something like ‘renderPagination’ or so on.


After having another cup of coffee i thought that it was bullshit what i wrote.

Of course there is a different logic between a dataprovider and a widget which just displays the data.

But then i thought what is the advantage of a ListView which doesn’t show a pager if pagination is set for the data? So maybe pagination should be forced if DataProviders pagination isn’t set to false or ListView should set DataProviders pagination to false if enablePagination=false?!