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 7176211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:27:40+00:00 2026-05-28T16:27:40+00:00

I am wondering if CodeIgniter allows segments after the page number and what is

  • 0

I am wondering if CodeIgniter allows segments after the page number and what is the best way to do this?

$config['base_url'] = '/controller/view/pg/';

I need my paging to pass this also:

/controller/view/pg/1/v/l/rpp/20 … etc

I have ran into multiple problems because I am using $this->uri->uri_to_assoc(n) because of the number of segments I will be needing…

I need to be able to pass values to each page, and at this point I’m not sure how to do it.

Do you think the best way to do this is to always move the paging to the end of all other segments? It seems that this leads to problems also.

  • 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-28T16:27:41+00:00Added an answer on May 28, 2026 at 4:27 pm

    Jason, you are making the problem yourself simply because you loose track of what segements are part of the controller/method, and which are your segments that you find relevant.

    I would first of all tell you to stick to one method say to append it to the end (this is from the users perspective in the uri, not your route config):

    /view/page/1233/name/blue-skies/pg/20
    

    The above format would mean something like this on the backend:
    /view/ is the controller, page is your method in the controller, then you would use $this->uri->uri_to_assoc(4) (4th element, being name to start).

    That way you correctly capture your page number 1233 and then all relevant data to it.

    As a suggestion, I would caution against using unreadable variables, it leads to confusion and does NOT make your site url SEO friendly (who knows what /v/p/123/v/l/20 means in the end?).

    Always user your $this->output->profiler(TRUE);, if you are having trouble with uri routing. Don’t mess with your route config unless you REALLY need to, this may lead to confusion, which complicates your testing.

    EDIT

    I created confusion because based on your question you could interpret it as a routing issue from the position of the config.php file OR the pagination class. I took it from the first approach.

    To clarify you need to simply stick to a clean url method, if you use uri_to_assoc, thats fine. But just don’t loose track of your page number for the pagination.

    You can solve this by making the page number the last element in your uri

    Last: /view/page/1233/name/blue-skies/user/12/20

    Where the 20 is the page number that is generated by pagination, the other are segments you use for whatever.

    You would set your $config['uri_segment'] = 6; in this case, and your $config['base_url'] = '/view/page/1233/'.$this->uri->assoc_to_uri($uri_segments);

    Where:

    $uri_segments = array(
     'name' => 'blue-skies',
     'user' => '12');
    

    IF

    It is unknown how many segments you have (say a dynamic $uri_segments array), use $this->uri->total_segments() to count total segments, then your pagination one is the +1 to that (last).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been wondering what's the best way to deal with exceptions on CodeIgniter .
I was wondering what is the best way to have a web page inside
I was wondering how one could make codeigniter style url segments on a project.
I am learning CodeIgniter. I am wondering which one is the best practice to
I'm developing a REST CodeIgniter Controller and need to POST and PUT to a
I'm using Codeigniter if this makes it easier. I'm wondering if a website is
I'm wondering if there's a way to dump all of the values of $this->session->userdata()
CodeIgniter allows access to POSTed data via: $this->input->post('input_name'); where 'input_name' is the name of
I'm wondering how $this->load->vars() works in CodeIgniter. The documentation is fairly vague about it.
I am wondering if you were to write the following Codeigniter PHP code: $this->load->library('form_validation');

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.