Cpagination Class

Hello, I have problems with CPagination class. I have decided to extend it. I create file CustomPager.php in folder

protected/components




Yii::import('system.web.CPagination');


class CustomPager extends CPagination

{

    public function createPageUrl($controller, $page)

    {

        $params = $this->params === null ? $_GET : $this->params;

        

        if($page > 0) 

        {

            $params[$this->pageVar] = $page+1;

        }

        else

        {

            unset($params[$this->pageVar]);

        }

        

        if(isset($_POST) && count($_POST) > 0)

        {    

            foreach($_POST as $key => $value)

            {

                $value = intval($value);

                

                if($value > 0)

                {

                    $params[$key] = $value;

                }

            }

        }

        

        return $controller->createUrl($this->route, $params);

    }

}



in main.php I have loaded this class




// autoloading model and component classes

    'import'=>array(

        'application.models.*',

        'application.components.*',

        'application.components.CustomPager.*',

    ),



in controller




//Pagination

$pages = new CustomPager($item_count);

$pages->setPageSize($viewTypeData[2]);

        

//Render of view

$this->render($viewTypeData[1], array(

    'data'=>$data,

         'item_count'=>$item_count,

         'page_size'=>$viewTypeData[2],

          'pages'=>$pages,

         'page'=>$page

));



but it doesn’t work.

Hi,

where is the setPageSize() in CustomPager class?

there is no such method defind in CustomPager class so, how it calls setPageSize().

This method in CPagination http://www.yiiframework.com/doc/api/1.1/CPagination#setPageSize-detail

up

Anybody can help me? May be somebody from developer’s stuff help me?