Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     $countQuery = clone $this->query;
     $pagination = new \yii\data\Pagination(['totalCount' => $countQuery->count(), 'pageSize' => $this->pageSize]);
     $this->query->offset($pagination->offset)->limit($pagination->limit);
     return $this->render("userListBox", ['title' => $this->title, 'users' => $this->query->all(), 'pagination' => $pagination]);
 }
Exemplo n.º 2
0
 /**
  * @param int $page
  */
 public function setPage($page)
 {
     $offset = ($page - 1) * $this->limit;
     $this->query->offset($offset);
 }