-
Notifications
You must be signed in to change notification settings - Fork 2
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
Directory structure, naming conventions and stuff #11
Comments
Very nice. A few questions/comments:
|
|
|
@potfur I have question about module's bootstrap file. What exactly this mean? Is it just simple array or something more complex eg class with common interface? |
@seclu Simple array - look at current |
@potfur Ok, I understand. I'm not sure that this solution is enough good. I think that good and safe boundary for every module is common interface. In other hand I don't have any strong argument against array :) IMHO interface is just more flexible and programmer friendly. |
I think I would also prefer a ModuleInterface where we ensure a certain structure. Currently I don't know yet what the bootstrap should do or return 😃 |
Bootstrap is always a configuration array - same as described in Moss config. |
I am very much in favour of an interface. I think we should find a way to do that. It does not really matter if Moss natively uses arrays, we can still abstract that to an object if we think it is better. |
Maybe something like this: interface VoxModuleInterface {
public function name();
public function ver();
public function registerConfigVars(ConfigInterface $config);
public function registerComponents(ContainerInterface $container);
public function registerEventListeners(ConfigInterface $dispatcher);
public function registerRoutes(RouterInterface $router);
} This is just a rough sketch, probably there will be more |
We should define directory structure that will be used in modules/packages/bundles (or whatever name we will use) - what is the name of directory with controllers, models, repositories and stuff.
Also should we use always singular or plural?
My proposition is like this:
Where
module
is the name of ... module.end
isfrontend
/backend
/otherend
directory.This means that we have a module which supports frontend and backend or just backend functionality.
/Entity/
is a directory for entities, ie.Post
,User
etc./Controller/
for controllers for set*end
,/Model/
ideally only models should contain logic, but ... we won't have complex logic/Repository/
classes that have access to database/Resource/
all stuff that should be copied from module to public directory ie. images, css, fonts etc./View/
view templatesThe text was updated successfully, but these errors were encountered: