Welcome Guest, Not a member yet? Register   Sign In
4.4.4 customizing pagination links
#1

(This post was last modified: 01-17-2024, 05:59 AM by cadgiru. Edit Reason: Expanded scope )

Using default_full
pls can U help me change the pagination look, would like to replace first with '<<' , previous '<' , last '>>' , next '>' ?

Found a crude but easy way of doing this, probably not recommended:

With : ./vendor/codeignator4/framework/system/Language/en/Pager.php

Commented out original array and replaced with modified
Code:
<?php

/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

// Pager language settings
/*return [
    'pageNavigation'        => 'Page navigation',
    'first'                  => 'First',
    'previous'              => 'Previous',
    'next'                  => 'Next',
    'last'                  => 'Last',
    'older'                  => 'Older',
    'newer'                  => 'Newer',
    'invalidTemplate'        => '"{0}" is not a valid Pager template.',
    'invalidPaginationGroup' => '"{0}" is not a valid Pagination group.',
];*/

return [
    'pageNavigation'        => 'Page navigation',
    'first'                  => '<<',
    'previous'              => '<',
    'next'                  => '>',
    'last'                  => '>>',
    'older'                  => 'Older',
    'newer'                  => 'Newer',
    'invalidTemplate'        => '"{0}" is not a valid Pager template.',
    'invalidPaginationGroup' => '"{0}" is not a valid Pagination group.',
];

q1 Can anyone please help with a more valid way of doing this?
q2 Is it possible to replace the text based links with icons / buttons ?
q3 Can somebody provide css on how to format links ?
Reply
#2

CodeIgniter 4 User Guide - Pagination - Customizing the Links
What did you Try? What did you Get? What did you Expect?

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

(01-21-2024, 11:08 PM)InsiteFX Wrote: CodeIgniter 4 User Guide - Pagination - Customizing the Links
Got what I hoped for, but felt quite sure I was not doing it the correct way.. Pls, scroll in the code section.
Reply
#4

You need to create a template like it shows, you can copy the ones out of system/Pager/Views to work with.
You need to edit app/Config/Pager and add your template name to it.
Create a Pager folder under the app/Views/Pager and add your Pager view template to it.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB