AltoRouter icon indicating copy to clipboard operation
AltoRouter copied to clipboard

Permit return of named routes

Open bellwood opened this issue 8 years ago • 2 comments

By passing a boolean of TRUE to the getRoutes function you can retrieve a list of named routes which is handy if you want to quickly process your routes to build a sitemap vs iterating over the much larger routes.

bellwood avatar Jun 01 '17 13:06 bellwood

While this wasn't added in @dannyvankooten AltoRouter, I have included a method that is literally just: $AltoRouter->getNamedRoutes() for this same purpose.

I would think having the method named makes it much simpler as you know exactly what you're going to get, where using getRoutes() with a parameter isn't quite verbose enough, then again I like to make things too easy sometimes.

mastacontrola avatar Jan 26 '18 02:01 mastacontrola

getNamedRoutes would be the way to go, but why exactly do the named routes have to be accessible? Can you give an example?

koenpunt avatar Jan 28 '18 10:01 koenpunt