public function index($offset = 0) { $this->load->library('pagination'); $config['base_url'] = site_url('tutores/index'); $config['total_rows'] = Tutor::count(); $config['per_page'] = '10'; $config['num_links'] = '1'; $config['first_link'] = '← primero'; $config['last_link'] = 'último →'; $this->pagination->initialize($config); $a = Tutor::find('all', array('limit' => $config['per_page'], 'offset' => $offset)); $this->table->set_heading('Nombre', 'Apellido', 'Telefono', 'Celular', 'Acciones'); foreach ($a as $al) { $this->table->add_row($al->nombre, $al->apellido, $al->telefono, $al->celular, anchor('tutores/editar/' . $al->id, img('static/img/icon/notepad_2.png'), 'class="tipwe" title="Editar tutor"') . ' ' . anchor('tutores/eliminar/' . $al->id, img('static/img/icon/trash.png'), 'class="tipwe eliminar" title="Eliminar tutor"')); } $data['tutores'] = $this->table->generate(); $data['pagination'] = $this->pagination->create_links(); $this->template->write_view('content', 'tutores/index', $data); $this->template->render(); }