How To Set The "pagevar" Parameter For The Grid View Widget?


I have a gridview widget:

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

    'dataProvider' => $model->search(),

    'summaryText' => 'صفحه {page} از مجموع {pages} صفحه',

    'enableSorting' => false,

    'enablePagination' => true,

    'ajaxUpdate' => false,





In the pagination links it includes the model name as prefix to pageVar parameter. is there anyway to set the pageVar property of widget so it changes the links from "index.php?r=item/list&Items_page=2" to "index.php?r=item/list&page=2" ?



Dear Yaser

We have to set the pageVar property in dataProvider .

One example.

In Model

public function search()


	$criteria=new CDbCriteria;




	return new CActiveDataProvider($this, array(





		'pagination'=>array('pageVar'=>'page'),//as aproperty of CPagination




Thanks for the answer

It’s exaxtly what I was looking for :)