CodeIgniter Pagination – Bug suffix in first paging

when you use suffix in paging codeigniter, example to pass $_GET parameter

ci-suffix-page-2

you will find first or no 1 page not include your suffix

ci-suffix-page-1-bug

the problem in core, you must patch it self

system/libraries/pagination.php

line 231 – first link


$output .= $this->first_tag_open.'<a '.$this->anchor_class.'href="'.$first_url.'">'.$this->first_link.'</a>'.$this->first_tag_close;

to


$output .= $this->first_tag_open.'<a '.$this->anchor_class.'href="'.$first_url.$this->suffix.'">'.$this->first_link.'</a>'.$this->first_tag_close;

line 285 – 1 link


$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$loop.'</a>'.$this->num_tag_close;

to


$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.$this->suffix.'">'.$loop.'</a>'.$this->num_tag_close;

add $this->suffix variable after $this->first_url value

ci-suffix-page-1-patch

i think you must not ‘hack’ the $this->first_url value to concat with $this->suffix,  it will ruined the ‘if’ decision in line above

 

Published by

G3n1k

just to remember what i had known :)

2 thoughts on “CodeIgniter Pagination – Bug suffix in first paging”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s