steampixel / simplePHPRouter

This is a simple and small single class PHP router that can handel the whole url routing for your project.
MIT License
406 stars 117 forks source link

featureRequest: methode to Return all known routes #42

Closed cereal2nd closed 3 years ago

cereal2nd commented 3 years ago

it would be nice (to create some sort of help url) that there would be a methode to fetch all known routes.

this would make it easy to cerate a help page

steampixel commented 3 years ago

Hey @Cereal2nd, great idea. Please check out this branch and tel me if this fits the needs: https://github.com/steampixel/simplePHPRouter/tree/known-routes I have added a new method Route::getAll(). I also added a new example to the bottom of the index.php file. On top of that you could use a library like https://github.com/hoaproject/Regex to generate working example links for the different expressions.

cereal2nd commented 3 years ago

This is exactly what i was looking for (and did in my lcoal install)

i3iorn commented 3 years ago

@steampixel - Hello, do you plan on merging this with master?

steampixel commented 3 years ago

Hey, merged this and releases 0.7.0: https://github.com/steampixel/simplePHPRouter/releases/tag/0.7.0