• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI pagination help

im trying to use CI pagination and its creating pagination but facing one problem is that when i move from page 1 to 2 it not showing link on 1 and also not showing first and < links always showing > and last> links and 1 is always without link here is my line of codes which im using.

$config['base_url'] = base_url().'index.php/admin/content/view';
$config['total_rows'] = $this->contentmodel->getCount('wm_content');
$config['per_page'] = '5';
$data['count'] = $this->uri->segment(4);
$data['page'] = $this->pagination->create_links();;
$data['rows'] = $this->contentmodel->getContents('wm_content',$config['per_page'],$data['count']);

any body has solution to this problem

can anybody help me about the problem.

The only config variable that you're missing is "uri_segment":
$config['uri_segment'] = 4;

Try to set that one as well and see if it's working.

Take care,
MajiD Fatemian

hi thanks its working really good.

again thanks my another question about pagination is how to set any css class for the pagination to make it styled with css.

As they are all made by <a> tags, the best way is to wrap them in a <div> like this :
<div id='pagination_wrapper'>
    &lt;?PHP echo $pagination; ?&gt;

and then in your CSS file you can do it like this :
#pagination_wrapper a{
#pagination_wrapper a:hover{
    /*some other style*/

Let me know if it solved your problem.
MajiD Fatemian

that is the first option which i already have in my mind another thing is that we can not put direct class or id in a tag.

can you explain more about the restrictions you have because in that case someone will have better ideas about your situation.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.