Welcome Guest, Not a member yet? Register   Sign In
how to pass a parameter to the controller through the route?
#2

(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:

PHP Code:
$route['default_controller'] = array('normalroute'$parameter); 

Can anyone give me a hint on how to do it? Ty!

$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.
Reply


Messages In This Thread
RE: how to pass a parameter to the controller through the route? - by portaflex - 08-30-2016, 04:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB