AltoRouter
AltoRouter copied to clipboard
add run function
Hi. I would like to add a run
method to start the router. This pattern (of defining the routes and then starting the router) typically exist in all the routers I know of, in Java, React, Node, etc...
This would make the library easier to start with and reduces the boilerplate code in users' code.
We can still let the user control what happens if no matching route found via passing an optional callable to the run
method.
Any thoughts ?
I use basically this, $presenter
is a configuration array from NEON file:
$alto = new \AltoRouter(); foreach ($presenter as $k => $v) { $alto->map($v["method"], $v["path"], $k, "route_${k}"); if (substr($v["path"], -1) != "/") { $alto->map($v["method"], $v["path"] . "/", $k, "route_${k}_x"); } }
Can you give an example of how that would work?
Oh I now see your PR
Oh I now see your PR
check Tesseract LASAGNA
project app.php
Hello y'all ! Knowing hop usefull os altorouter that i discovered thanks to Grafikart on YouTube via his php lessons, i Would like to Know more With a good tutorial on YouTube
Tutorial about altorouter on YouTube will ne very usefull. The creators must think to this
Yes, a person typing typos, humming, hawing and bumbling around in a YouTube video is a great idea. Or even better, written text tutorial that can be quickly fixed and provide the info in a quicker fashion.
Hello everybody ! How am you? I'm well but a little sad. Why? Don't worry. Just because I've spent many times on YouTube to view videos about the best simple and useful routers I ever had used: AltoRouter. I sincerely have heard about it following Grafikart php tutorials videos. However, he didn't spend his time on explaining profoundly this router use. I exhort those of you guys, who are very best on teaching to make videos for teaching us, noobs, step by step, how to use altorouter. It will be very kind and good help.
Thanks and nice day to y'all.