• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optional param in routing

#1
Question 
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.