“Contoh Pagination Codeigniter” Kode Jawaban

Pagination in Codeigniter dengan contoh

// Controller End
$config = array();
$config["base_url"] = base_url() . "index.php/StudentPagination_Controller/index";
$config["total_rows"] = $this->StudentPagination_Model->get_count();
$config["per_page"] = 10;
$config["uri_segment"] = 3;

$this->pagination->initialize($config);


$page = ($this->uri->segment(3))? $this->uri->segment(3) : 0;

$data["links"] = $this->pagination->create_links();

$data['student'] = $this->StudentPagination_Model->get_students($config["per_page"], $page);

$this->load->view('pagination', $data);
Ankur

Contoh Pagination Codeigniter

<?php

namespace App\Controllers;

use CodeIgniter\Controller;

class UserController extends Controller
{
    public function index()
    {
        $model = new \App\Models\UserModel();

        $data = [
            'users' => $model->paginate(10),
            'pager' => $model->pager,
        ];

        echo view('users/index', $data);
    }
}
Brave Bat

Pagination Codeingiter

$this->load->library('pagination');

$config['base_url'] = 'http://example.com/index.php/test/page/';
$config['total_rows'] = 200;
$config['per_page'] = 20;

$this->pagination->initialize($config);

echo $this->pagination->create_links();
Sikadner

Jawaban yang mirip dengan “Contoh Pagination Codeigniter”

Pertanyaan yang mirip dengan “Contoh Pagination Codeigniter”

Lebih banyak jawaban terkait untuk “Contoh Pagination Codeigniter” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya