I have a controller name 'abc'
Now, I define a index function in it.
Now as i go to www.example.com/abc/ or www.example.com/abc/index i can see my page appearing.
Now when i pass argument in that index function i would have to call it as:
www.example.com/abc/index/argument
So, How can i call my argument as
www.example.com/abc/argument
without treating this 'argument' as public function ?
you can add routing for it in your routes.php file, like:
$route['abc/(:any)'] = 'abc/index/$1';
doing this will route your url www.example.com/abc/argument to www.example.com/abc/index/argument
Are you looking for remapping ?
public function _remap($method, $params = array())
{
if (method_exists($this, $method))
{
return call_user_func_array(array($this, $method), $params);
}
else
{
return $this->index($method);
}
show_404();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With