Welcome Guest, Not a member yet? Register   Sign In
Pager->links customization
#1

Hello,
I'm using the pager->links function to display page numbers & links on my search results page.
However, this function also display extra text links such as "Next" & "Last", that I would like to hide. (I would like to keep only page numbers links)
As there is no CSS class generated to hide them, is there another way to achieve this ?
Thank you!
Reply
#2

See https://codeigniter4.github.io/CodeIgnit...-the-links
Reply
#3

Hello Kenjis,

I've tried creating a custom pagination view, using exactly the examples given in the documentation, but I end up with only 1 page result instead of more...
I'm using CI 4.2.4, could this be the reason ?

Thank you
Reply
#4

As far as I know, there is no bug around pagination recently.
So v4.2.x should work.
Reply
#5

Works fine for me with Custom Templates. php 8 and CodeIgniter 4.3.2.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#6

In which file could I check the actual view code executed by the native $page->links() function ?
Maybe I could spot my mistake, by comparing the 2 codes ?

Thank you
Reply
#7

You need to check only two files.

Config:
PHP Code:
<?php

namespace Config;

use 
CodeIgniter\Config\BaseConfig;

class 
Pager extends BaseConfig
{
    public $templates = [
        'default_full'  => 'CodeIgniter\Pager\Views\default_full',
        'default_simple' => 'CodeIgniter\Pager\Views\default_simple',
        'front_full'    => 'App\Views\Pagers\foundation_full',
    ];

    // ...


View:
PHP Code:
<?= $pager->links('group1''front_full'?>
Reply




Theme © iAndrew 2016 - Forum software by © MyBB