Welcome Guest, Not a member yet? Register   Sign In
Route with optional parameter
#2

Since the config files are running PHP, you could do something like this in Routes.php:
PHP Code:
$r = ['logout'];
$arg = [];
for (
$i 1$i <= 4$i++) {
    
$routes->get(join('/'$r), 'Home::logout/' join('/'$arg));
    
array_push($r'(:any)');
    
array_push($arg'$' $i);

Reply


Messages In This Thread
Route with optional parameter - by Cyto5 - 07-17-2020, 10:52 AM
RE: Route with optional parameter - by tgix - 07-17-2020, 11:03 PM
RE: Route with optional parameter - by jreklund - 07-18-2020, 02:12 AM
RE: Route with optional parameter - by tgix - 07-18-2020, 02:57 AM
RE: Route with optional parameter - by MGatner - 07-22-2020, 02:03 PM
RE: Route with optional parameter - by edyahui - 11-16-2020, 06:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB