I just started refactoring my non-framework project into using Slim and Twig to try and make it follow a more modern design pattern.
I've come to the conclusion already, that for each route I have on my site, I will have to have a corresponding require with a matching path - or a require that has all possible paths in one (I don't know if there's a noticeable difference there aside from the logical separation of code).
It does not make sense in my head to include possibly (in my case) 80-100 routes and try and match them for every single request when the request could determine where we wanted to go in the first place - assuming we went away from the single-point-of-entry philosophy that Slim and so many other frameworks build upon. Is this how it's supposed to work or is there something I have misunderstood? I have read numerous tutorials on many different frameworks in attempt to find the right one for my project (which in itself was and still is a nightmare), and none of them seem to touch on the subject of "Hey - why are we doing this so inefficiently?"
Is the include/require operation simply so fast that we should not care, and we just sacrifice this for manageability? Excuse my ignorance, but when coming from a project where I only type require/include when I actually need something, this seems, well, stupid. I should mention that that development style has turned my project into chaos, which is why I've ended up here with Slim in the first place.
I just want to understand if I'm doing it right.