Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 640359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:56:40+00:00 2026-05-13T20:56:40+00:00

I am using codeigniter and its pagination class. It works perfectly and it looks

  • 0

I am using codeigniter and its pagination class. It works perfectly and it looks something like this:

« First < 1 2 3 4 5 > Last »

Here is my code:

$this->load->library('pagination');
$config['base_url'] = base_url().'controlpanel/';
$config['first_link'] = 'First';
$config['total_rows'] = $count;
$config['per_page'] = '3'; 
$this->pagination->initialize($config); 
$data['pagination'] = $this->pagination->create_links();
$this->load->view('controlpanel', $data);

I have this in my routes:

$route['controlpanel/(:num)'] = "controlpanel/index/$1";

However, whenever I get to a differentpage i.e. controlpanel/3 – the number 1 is always bold – it should change to 2 or 3 etc!

Why doesn’t it?

When I change the $config['base_url'] to base_url().'controlpanel/page' then does the pagination work correctly by boldening the correct number – but the link 1 points to the URL controlpanel/page which is the wrong page for me as the base is just controlpanel.

Thanks all for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:56:41+00:00Added an answer on May 13, 2026 at 8:56 pm

    The pagination class should check the second parameter, not the third(default).

    Add this to the config array to change this:

    $config['uri_segment'] = '2'; 
    

    This won’t change anything but be helpful in creating the url needed.
    change this :

    $config['base_url'] = base_url().'controlpanel/';
    

    to this:

    $config['base_url'] = site_url('controlpanel');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using codeigniter and its routes system successfully with some lovely regexp, however
I've starting using Codeigniter for a project recently (few months ago) but its getting
I am using codeigniter's session class to handle my PHP sessions. One of the
So this is my dilemma - I am using the excellent codeigniter-simpletest library by
It's ok to upload image in file using codeigniter upload library with this example.
I am using CodeIgniter to pass some parameters to my PHP page through $_POST
I am writing a webapp using CodeIgniter that requires authentication. I created a model
I am developing a website using CodeIgniter and PHP. Some of my friends suggest
I am thinking of using a PHP framework called CodeIgniter . One of the
I've been using CodeIgniter for some quite time, and I've been extremely happy with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.