“Parameter opsional rute codegniter4” Kode Jawaban

Cara Mengatur Parameter Ketiga Opsional di Rute Codeigniter

$routes->get('logout/(:any)', 'Login::logout/$1');
$routes->get('logout', 'Login::logout'); 

public function logout($param1 = null, $param2 = null, $param3 = null)
{
    var_dump($param1, $param2, $param3); exit;
}
Ankur

Parameter opsional rute codegniter4

$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') 
Matteoweb

Jawaban yang mirip dengan “Parameter opsional rute codegniter4”

Pertanyaan yang mirip dengan “Parameter opsional rute codegniter4”

Lebih banyak jawaban terkait untuk “Parameter opsional rute codegniter4” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya