0 votes
in CodeIgniter by
edited by

Explain the remapping method calls in CodeIgniter.

🔗Source: CodeIgniter Interview Questions and Answers

🔗Source: JAVA Interview Questions and Answers

1 Answer

0 votes
by
The Second segment of URI determines which method is being called. If you want to override it, you can use _remap() method. The _remap method always get called even if URI is different. It

overrides the URI. For Example:

public function _remap($methodName)  

{  

            if ($methodName === 'a_method')  

            {  

            $this->method();  

            }  

            else  

            {  

            $this->defaultMethod();  

            }  

}
...