Answer the question
In order to leave comments, you need to log in
Why does Yii1 incorrectly paginate a GridView by referring to the main page?
There is a grid on the it/task/index
page
$this->widget('zii.widgets.grid.CGridView', array(
'id' =>'grid-task',
'dataProvider' => $dataProvider,
'columns' => array('_id')
));
$model = new Task;
$dataProvider = new EMongoDataProvider($model , array(
'criteria' => array(
'condition' => array(),
'sort' => array(),
'skip' => 1,
'limit' => 1
),
));
$this->render('task/index', compact('dataProvider'));
Answer the question
In order to leave comments, you need to log in
In general, I found the reason.
My controller is inherited from its own class, which is inherited from the base.
I didn't add
parent::__construct($id, $module); in the constructor;
It is $id that allows the framework to understand where to get templates from.
public function __construct($id,$module = null)
{
$this->to_page = app()->user->getState('to_page', app()->params['to_page']);
parent::__construct($id, $module);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question