Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

codeigniter4 route optional parameter

$routes->get('logout', 'Login::logout')
$routes->get('logout/(:any)', 'Login::logout/$1')
$routes->get('logout/(:any)/(:any)', 'Login::logout/$1/$2')
$routes->get('logout/(:any)/(:any)/(:any)', 'Login::logout/$1/$2/$3')
$routes->get('logout/(:any)/(:any)/(:any)/(:any)', 'Login::logout/$1/$2/$3/$4')
$routes->get('logout/(:any)/(:any)/(:any)/(:any)/(:any)', 'Login::logout/$1/$2/$3/$4/$5') 
 
PREVIOUS NEXT
Tagged: #route #optional #parameter
ADD COMMENT
Topic
Name
6+4 =