Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 4 routing with optional placeholder
#1

Hello,
I am fairly new to Codeigniter and have a problem with routing when passing a parameter.
The problem is that the parameter I need to pass is a variable not always present.
Essentially I need the following two cases to be valid when routing

$routes->add('area-riservata','Areariservata::index');
$routes->add('area-riservata/(:any)','Areariservata::index/$1');

But cannot have them both at the same time in the Routes.php file.
How can I have the above two cases coexist at the same time?

Thanks for your help.
Reply


Messages In This Thread
Codeigniter 4 routing with optional placeholder - by AndreaL - 10-06-2020, 01:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB