public function showModelAction($offset = 0) { $this->_view->title = 'Active Record Database MVC'; $users = new Peoples(); $items_per_page = 15; $offset = $offset % $items_per_page != 0 ? 0 : $offset; $rs = $users->find(NULL, 'user_id DESC', NULL, "{$offset},{$items_per_page}"); $pages = new Paginator(); $pages->current_url = base_url() . 'active-record/user-model/show-model/%d'; $pages->offset = $offset; $pages->items_per_page = $items_per_page; $pages->items_total = $users->getTotalRow(); $pages->mid_range = 7; $pages->paginate(); $this->_view->pages = $pages; $this->_view->rs = $rs; $this->_view->add_link = base_url() . 'active-record/user-model/add-model/'; $this->_view->edit_link = base_url() . 'active-record/user-model/edit-model/'; $this->_view->delete_link = base_url() . 'active-record/user-model/delete-model/'; $this->renderView('active-record/user-model/index'); }