-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple instances? #392
Comments
Well, I had a project where there was a main site, and a mobile site in the same code base, with different endpoints (so the main site was It worked, but I'm not sure I would do it that way again, especially if you're real goal is modular routes, rather than a single offshoot. If you want to have lots of routes in separate files, this might be a little ghetto, but it would work:
That would require that each route file you include be well-behaved, and that it would declare its routes using
Depending on the project, you might be able to get away with that, but I already admitted it's ghetto. The next step up would be to implement an API in your module architecture for requesting routes. So you would have something like this:
That's just off the top of my head. If you started to implement this, you'd probably come up with a better way to implement it, but it would do roughly the same thing. If you look at what the So you could make things a little more elegant like this:
It's basically the same thing as the one before, except the So if you do what I did in real life, you'd have multiple Klein instances, and extra htaccess stuff. On the other hand, if you follow the variations on a theme I just proposed, you'd keep a single instance of Klein, and avoid extra htaccess/modrewrite config, which I think is better part of valor. |
Can i call multiple instances of klein in:
/index.php
and let's say/modules/board/index.php
so they have routes of their own without being in one huge
/index.php
(p.s. also interested how this will workout for .htaccess in both paths)
The text was updated successfully, but these errors were encountered: