pagination problem

I am trying to paginate articles but at all pages all articles are there.

what is wrong?

public function actionIndex() {

        if (!isset ($_GET['code']))


        else {




        $criteria=new CDbCriteria;



        $criteria->order='art_short DESC';




        $pages=new CPagination($postCount);










have you tried to populate your $post after you setup your $pages? What does the gerid() method represent? What value is $this->pageSize?

I actually set


 $criteria->limit =$this->pageSize;



All my previous code was from blog demo, I do not know if I set it wrong.

so are you still experiencing a problem?

Since I set limit and offset , it is ok now

I have the same problem and trying to understand code.

What is $pg?

 if (!isset($_GET['page']))



            $pg=  intval($_GET['page']);