Closed oscarlosan closed 8 months ago
Perhaps you could try overriding the router. See here: https://flightphp.com/learn#overriding
If your controller methods need static parameters, then you may rethink your code design. The default router is optimized for capturing user-supplied dynamic inputs.
If your controller methods need static parameters, then you may rethink your code design. The default router is optimized for capturing user-supplied dynamic inputs.
I agree, I think that this isn't the way to go with the framework moving forward, but appreciate the feedback! Overriding is probably your best bet.
//it would be interesting to be able to pass parameters. It would reduce my code by 30%. All in the same line:
Flight::route('/', array('Greeting','hello', ['planet' => 'Earth']));