Fatal Error: Unsupported Operand Types In C:\xampp\htdocs\framework\web\cpagination.php

Hello all, I am new to Yii ,i am learning to build a website with Yii,currently i am working on pagination part,

i have a little problem with pagination i am using an extension to load on the index.php page in that(extensions/dept) i have ShowDepts.php and a views folder under which i have a listing.php & _view.php file i have used CSqlDataprovider on ShowDepts.php and ClistView widget on listing.php where ‘itemView’=>’_view’

but i am getting Fatal error: Unsupported operand types in C:\xampp\htdocs\framework\web\CPagination.php on line 144

My files are ShowDepts.php



class ShowDepts extends CPortlet {

    public $where = "";

   // public $view = "index";

    public $view = "listing";


    public $link;

    public function init() {

        $this->link = new Link();

        return parent::init();


    private function getdepts() {

        $query = "SELECT * FROM department ";

        if ($this->where && is_string($this->where)) {

            $query .= " where $this->where";


        // echo $query;exit;

        $command = Yii::app()->db->createCommand($query);

        //return $cates = $command->queryAll();

        $cates = $command->queryAll();

        return $dp = new CSqlDataProvider($query, array(

            'totalItemCount' => $cates,

            'keyField' => 'link_rewrite',

            'pagination' => array(

                'pageSize' => 10,




    public function renderContent() {

        $dataProvider = $this->getdepts();


        $this->render($this->view, array('dataProvider' => $dataProvider));

        return parent::renderContent();






$id = Yii::app()->user->getId();



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

    'dataProvider' => $dataProvider,

    'itemView' => '_view',

    'template' => '{pager}{items}{pager}'

   // 'viewData' => array('logged_in_id' => $id)




<div class="TabbedPanelsContent TabbedPanelsContentVisible" style="display: block;">


        <?php foreach ($categories as $category): ?>


                <a title="<?php echo $category["departname"] ?>" href="<?php echo $this->link->deptDetailLink($category["link_rewrite"]) ?>" class="item_name">

                    <?php echo $category["departname"] ?>



        <?php endforeach; ?>



It looks like you are not using the newest version of Yii (1.1.15) and I cannot locate the proper line in CPagination file.

Try this topic http://www.yiiframework.com/forum/index.php/topic/25901-pagination-solution-simple-and-complex-ways/ and maybe you will find answer there.