Welcome Guest, Not a member yet? Register   Sign In
Using variables as the controller name for routes
#1

Hello, I have a POST request. For example
/admin/something/(:any)

And I would like to use (:any) as a class variable. For example
$routes->post('/admin/something/(:any)', 'admin/$1::methodname');

Using $1 does not work under any circumstance and it seems that this slash is being trimmed in the Router.php system file.
How can I use it as a variable? Additionally, how could I also use the method as a variable after the double colons? :: For example:
$routes->post('/admin/(:any)/(:any)', 'admin/$1::$2');

Thank you!
Reply


Messages In This Thread
Using variables as the controller name for routes - by eri146 - 06-11-2021, 11:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB