help getting all routes in an array in controller |
A quick followup that partially works. I can do:
PHP Code: include(APPPATH . 'Config\Routes.php'); Which is a really bad idea, but $routes->getRoutes() will give me all of the available GET routes. The docs say that that this Returns the raw array of available routes. (https://codeigniter4.github.io/api/class..._getRoutes) which is partially true. It seems to only return the routes available to the current http request type. So if I do GET myController.php it shows me only the GET routes. If I do POST myController.php it only shows me the POST routes. $routes->setHTTPVerb('POST'); sounds like it ought to work, but it doesn't. If I do a GET request and set the verb to POST, I only get an empty array. |
Messages In This Thread |
help getting all routes in an array in controller - by rramsey - 12-12-2022, 07:45 AM
RE: help getting all routes in an array in controller - by rramsey - 12-12-2022, 09:05 AM
RE: help getting all routes in an array in controller - by ikesela - 12-12-2022, 09:16 AM
RE: help getting all routes in an array in controller - by kenjis - 12-12-2022, 07:26 PM
RE: help getting all routes in an array in controller - by mshannaq - 10-15-2023, 07:04 AM
RE: help getting all routes in an array in controller - by kenjis - 10-15-2023, 06:30 PM
|