Reputation: 2201
I have some experience with Yii from an year ago, but I cannot solve this simple task for a website I have to take over as developer;
I have the following (very simplified):
CONTROLLER
$data = $this->webshop->$funcname($_POST['fromDate'],$_POST['toDate'],$_POST['category']);
//this may contain thousands of rows
$this->render('index', array(
'model' => $this->oStatForm,
'data' => $data,
'sum' => $sum,
));
VIEW
<div class="gridview" id="stat_grid">
<?php echo $this->renderPartial('table',array('data'=>$data)); ?>
</div>
and in the table there is a foreach
which prints the table rows. I have to implement pagination in the whole thing... but I have no idea how to do this, since POST is used. CLinkPager was my first try, but it works with GET...
Upvotes: 0
Views: 73
Reputation: 915
I recommend you using CGridView with CActiveDataProvider and all pagination, filtering, etc. will be done automatically.
Upvotes: 1