I tried something with a similar approach and file structure, it works well enough and i would prefer to handle my own modules anyway, its not something i would use even if the framework offered it
so far ive only had a chance to make a basic test so its kinda crude but might give you some ideas
at the end of the main index file i used this ugly business to kick it off for now
foreach (glob(‘…/app/module/ * / * .Config.php’) as $file){ include($file); }
(ignore extra spaces not sure why it wont display slash star slash star)
ie a path like this
“/app/module/test/Test.Config.php”
which is a class that instantiates itself, which can dial back to the main application to register and request further loading
i just use the module folder / key as a url group to keep the urls separate
then i just relative my way to the template dir in the controller for now
$this->renderStandard($response, ‘/…/…/module/test/view/page/getTest.php’, $args);
which at least got me into a template and on screen
so rather than trying to do bootstrap/container/route for core and all modules at the same time, i just do bootstrap/container/route for core first, then load each module completely one at a time, where more checking / communication with core can be done and then hopefully a module shouldnt be able to sink the main app and it should be possible to install/uninstall/enable/disable/rollback whatever
only unknown i have is the public resources
im still rendering with the main application layouts so i have the core js/css loaded
i could do the same again and expand on something like this in the template with the head tag
‘…/app/module/public/*.js’) as $file) etc
but i dont really want to go rifling through modules from the core aside from the main loading
i want all the installing/loading code in one spot so it either works or doesnt and cant get stuck half way
i could use rendered sub-templates with script tags in templates to reuse css/js but that doesnt help me with images icons downloads etc
which i think leaves me at putting a module directory in the main public folder or some kind of mod_rewrite hackery