-
-
Save uno-de-piera/96f5cdd3f902925690055d99c5e32dbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Post extends CI_Controller | |
{ | |
function __construct() | |
{ | |
parent::__construct(); | |
$this->load->model('post_model'); | |
} | |
function index() | |
{ | |
$data['title'] = 'Paginacion_ci'; | |
$pages = 10; | |
$this->load->library('pagination'); | |
$config['base_url'] = base_url().'post/pagina/'; | |
$config['total_rows'] = $this->post_model->filas(); | |
$config['per_page'] = $pages; | |
$config['num_links'] = 20; | |
$config['first_link'] = 'Primera'; | |
$config['last_link'] = 'Última'; | |
$config["uri_segment"] = 3; | |
$config['next_link'] = 'Siguiente'; | |
$config['prev_link'] = 'Anterior'; | |
$this->pagination->initialize($config); | |
$data["posts"] = $this->post_model->total_paginados($config['per_page'],$this->uri->segment(3)); | |
$this->load->view('posts', $data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment