how to pass a parameter to the controller through the route? |
Hello guys! I need to pass a parameter to the controller through the route, however, as it is a fixed parameter for each route does not want him to interfere in the url. It is something like this:
PHP Code: $route['default_controller'] = array('normalroute', $parameter); Can anyone give me a hint on how to do it? Ty! (08-30-2016, 01:28 PM)Angelo Wrote: Hello guys! I need to pass a parameter to the controller through the route, however, as it is a fixed parameter for each route does not want him to interfere in the url. It is something like this: $route['default_controller'], as the name says, just set the default controller when you enter http://yourdomain.com in the URL. In your case i would use: PHP Code: $route['/(:any)'] = '/normalroute/$1'; Or you can just set your default controller to 'normalroute': PHP Code: $route['default_controller'] = "normalroute"; Every call to http://yourdomain.com would go to your 'normalroute' and every parameter passed to it. Here is the explanation Hope this helps. Regards. |
Welcome Guest, Not a member yet? Register Sign In |