public function indexAction() { parent::init(); parent::ajaxEnabled(); $modelUsers = new Admin_Model_Users(); $page = $this->_getParam('page', 1); $orderBy = $this->_getParam('orderBy', $modelUsers->getPrimary()); $orderBySort = $this->_getParam('orderBySort', 'ASC'); $level = array(); foreach ($modelUsers->fetchAll() as $user) { $userInfo = $modelUsers->fetch($user['userId']); $level[$user['userId']] = $userInfo->level; } $this->view->level = $level; $this->view->users = $modelUsers->fetchAllWithPagination($page, $orderBy, $orderBySort); }