CodeIgniter Pagination Class – Url with get parameter

let say you have paging for search content like this

search is controllers, result is function

and you want to pass parameter $_GET to ur, so the result will see like this

the problem you need paging to make your (download) data client smaller

the solution you can modify the search function to accept parameter page, and set ‘suffix’ pagination configĀ  value

class search extend CI_Controllers {


function result ( $page = 0) {

// your result here


$cfg = array(



'uri_segment' => 3,

'per_page'=> 20,

'total_rows' => 100,

'suffix' => '?' . http_build_query($_GET, '', "&")



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




and the result will look like this



Published by


just to remember what i had known :)

2 thoughts on “CodeIgniter Pagination Class – Url with get parameter”

Leave a Reply

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

You are commenting using your 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