plasid / slim-magic

A bootstrapper/classmapper/dynamic router for Slim Framework 3x. Keeping your Slim bootstrapping clean no matter how many routes, dependencies and middleware you have, allowing you to build really large applications in a structured manner.
MIT License
4 stars 0 forks source link

Am I binded to the folder structure? #1

Open visualcookie opened 8 years ago

visualcookie commented 8 years ago

Hi, I'm currently building my own application and have been working with Sentinel and other tools so far.

What's really frustrating me at the moment is, that I have to define the ROUTES I want in my routes file. Now I've discovered your package and wanted to give it a try but before I do I have one simple question.

Am I binded to the folder structure in the README.md file or can I stay with my current folder structure in (https://github.com/visualcookie/slim-sentinel-auth). If not, I might have to refactor much.

Would love to get a feedback from you.

plasid commented 8 years ago

For now the service dependency and middleware paths are hardcoded, but you can add service directory names in the config file and then inside the SlimMagic/Mapper.php you can replace it with dynamic values from the config file - remember to also add the new paths to your autoload composer.json and run composer update.

Keep in mind that SlimMagic does not use middleware the standard "messy" way, In SlimMagic middleware and DI are wrapped (see https://github.com/atlantic8-web/slim-magic-example-simple) - this is because boostrapping middleware and DI the standard way in your index.php file can quickly make the index.php unorganized and difficult to maintain and moot for large applications