skipperbent / simple-php-router

Simple, fast and yet powerful PHP router that is easy to get integrated and in any project. Heavily inspired by the way Laravel handles routing, with both simplicity and expand-ability in mind.
631 stars 116 forks source link

route #684

Closed AlexJMcloud closed 3 months ago

AlexJMcloud commented 9 months ago

When specifying the route '/{lang}/' and '/admin/' - the router selects the first match. Route '/admin/' - it completely ignores. How can I fix this behavior?

the same behavior is observed with other routes: '/{lang}/auth/login' and '/admin/auth/login/'. However, their controller is different.

AlexJMcloud commented 9 months ago

I opened it here because I didn’t receive a response in the fork with version php 8.1.

xJuvi commented 3 months ago

Change the routes order. Load first the admin routes and then the dynamic language routes.

AlexJMcloud commented 3 months ago

Change the routes order. Load first the admin routes and then the dynamic language routes.

I wrote my own router. Sometimes it’s easier to do it yourself than to research crap code.