Welcome Guest, Not a member yet? Register   Sign In
Optional param in routing
#1
Question 
(This post was last modified: 04-09-2020, 11:37 AM by Michal_PB1.)

Hi,

Is it possible to mark a parameter for routing as optional?

Ok, I created the routes with different parameters and that works as I expected

$routes->get('add/(:any)/(:any)', 'CartController::add/$1/$2');
routes->get('add/(:any)/(:any)/(:any)', 'CartController::add/$1/$2/$3', ['as' => 'cart.add']);
Reply




Theme © iAndrew 2016 - Forum software by © MyBB