Exemplo n.º 1
0
 public function actionIndex()
 {
     $page = Yii::$app->request->get('page');
     if (!$page) {
         return $this->redirect('/admin/messages?page=1');
     }
     $count_message = AdminMessages::getMessages(0, 0, $count = true);
     $pages = new CustomPagination(['limit' => 10, 'page' => $page, 'count' => $count_message]);
     $messages = AdminMessages::getMessages($pages->limit, $pages->offset);
     return $this->render('index', ['messages' => $messages, 'pages' => $pages, 'count_message' => $count_message]);
 }