CodeIgniter Forums

Full Version: What does 'the segments passed to your function will be the re-routed ones.' mean exactly
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Can someone please explain? with an example ?


El Forum

It means that the method's parameters will ignore the URL in the browser if the URL has been moved using routes.

Example controller:

class Example extends CI_Controller {

public function yourmethod($var1, $var2)
  var_dump($var1, $var2);


Example route:

$route['fakecontroller/fakemethod/newvar/newvar2'] = 'example/yourmethod/oldvar/oldvar2';

If you go to your routed URL,, you'll see that those extra segments are not passed to the method's params. It will only use the routed (or "standard") URL segments.