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

  • Home
  • SEARCH
  • 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 8393759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:53:07+00:00 2026-06-09T19:53:07+00:00

The segments in a URI normally follow this pattern in Codeigniter: XYZ.com/Class/Method/param1/param2 This works

  • 0

The segments in a URI normally follow this pattern in Codeigniter:

XYZ.com/Class/Method/param1/param2

This works as expected when the called method is defined in the controller, but nothing works if I supply the URI with some undefined method to invoke the __call magic method that takes care of any undefined method.

__call is only invoked if its called from within the controller itself, not when I call some undefined method from the URI

Any explanation?

Thanks

  • 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-06-09T19:53:09+00:00Added an answer on June 9, 2026 at 7:53 pm

    In CodeIgniter, there is _remap. So if you go to

    XYZ.com/Class/UndefinedMethod/param1/param2

    then _remap will be called (actually _remap will always be called, so we need to make sure that methods that do exist are called correctly).

    function _remap($method, $params=array()){
        $funcs = get_class_methods($this);
        if(in_array($method, $funcs)){ // We are trying to go to a method in this class
            return call_user_func_array(array($this, $method), $params);
        }
        // else do something else
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can push a URI like this in CodeIgniter (1.7.1 currently): example.com/seg1/seg2/seg3/seg4/ or example.com/seg1/seg2/
I have a method in codeigniter that looks like this, public function category() {
In CodeIgniter it's really tricky to combine URI segments and Query strings at the
I am getting URI segments from CodeIgniter and using them in query to an
I'm wandering what the maximum URI length is in codeigniter, and if URI segments
I got a weird problem with CodeIgniter's URI segment system. When I have this
In my codeigniter application i want to display the uri segments.Iam using ajax to
I am wondering if CodeIgniter allows segments after the page number and what is
I've recently refactored an existing CodeIgniter application to use url segments instead of query
I'm having this problem with this piece of PHP code: class Core { public

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.