Problem with CLinkPager

Hi All,

I am having difficulty getting my CLinkPager to properly paginate my list. Instead of splitting my items into multiple pages it just puts them all onto one page. It seems to be able to tell how many pages it needs because it puts the right number of pages in the pager at the bottom but all the items end up on the first page.

My Controller Code:


 $pins = $pinCollection->findAll();



            $criteria = $pinCollection->getDbCriteria();






			$item_count = count($pins);

	        //$item_count = count(Pin::model()->count($criteria));



	        $pages = new CPagination($item_count);



	        $pages->applyLimit($criteria);  // the trick is here!



	                'pins' => $pins,






$pins is the whole list of items that I want to display

My View Code:

<?php if ($pins): ?>

    <table id="pinsDataGrid">

        <?php foreach ($pins as $_pin): ?>


            <td width="23">


                echo CHtml::image(Yii::app()->baseUrl . '/images/arrow.png', 'Drag to a folder or category', array(

                    'class' => 'draglist',

                    'title' => 'Drag to a folder or category',





        <?php endforeach; ?>




    $this->widget('CLinkPager', array(





            //'nextPageLabel'=>'My text >',








<?php endif; ?>

Thanks in advance

//$item_count = count($pins);

$item_count = count(Pin::model()->count($criteria));


No, unfortunately that makes the pager think that there is only one item to put into the list and it still dumps all the items onto the first page but it does not display the pager at the bottom.

I am trying to use the CListPager Widget inside of another widget. Could that cause an issue?