public function listAction() { if (!AuthModel::isLogin()) { header('Location: /auth/login/'); return; } $number = 10; $page = isset($_GET['page']) ? $_GET['page'] : 1; $limitOffset = ($page - 1) * $number; $this->page = $page; $this->pageCount = ceil(UsersPDO::count() / $number); $this->users = UsersPDO::getAllLimit($limitOffset, $number); if (Request::isAjax()) { $this->partialView('user_list_partial'); } else { $this->title = 'Users list'; $this->view('user_list'); } }