How to Use The Pagination Class In Codeigniter

If you do not know much more the term “pagination”, see the following screenshot that allows you to navigate from one page to another page. Here you can see the example of Codeigniter’s pagination how to make pagination in one of your controller methods. The $config array consists your configuration variables. It is transfer to the $this->pagination->initialize function as shown above screen. Eventhough there are some ten items you can able to configure, at minimum you need to show three. base_url is the complete URL to the controller class/function containing to your pagination. In the example above screen. Setting preferences available in a config file Customizing the Pagination: Your preferences might be set as below. $config[‘uri_segment’] = 3; $config[‘num_links’] = 2; $config[‘use_page_numbers’] = TRUE; $config[‘page_query_string’] = TRUE; Assume your links something like http://www.webtutorialspoint.com/index.php/test/page/20 $config[‘page_query_string’] set to TRUE, the pagination link will become like below http://www.webtutorialspoint.com/index.php?c=test&m=page&per_page=20 Note: The “per_page” is the default query string passed, however it can be configured using $config[‘query_string_segment’] = ‘your_string’ You can add Enclosing Markup $config[‘full_tag_open’] = ‘

'; $config[‘full_tag_close’] = ‘

'; Customizing the First Link and Last Link $config[‘first_link’] = ‘First'; $config[‘first_tag_open’] = ‘
'; $config[‘first_tag_close’] = ‘
'; $config[‘last_link’] = ‘Last'; $config[‘last_tag_open’] = ‘
'; $config[‘last_tag_close’] = ‘
'; Customizing the “Current Page” Link as a bold $config[‘cur_tag_open’] = ‘'; $config[‘cur_tag_close’] = ‘';
SHARE

Milan Tomic

Hai my name Edi Kustriyadi and l newbie :)

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

luvne.com ayeey.com cicicookies.com mbepp.com tipscantiknya.com kumpulanrumusnya.comnya.com