The module directory

The good way

The bad way

Advantage of doing the good way:

  • We can use multiple doctrine entity manager with consistent and simple configuration
  • Launching test module in parallele and loading only the code needed for the module.
  • We can setup different type of authentication by module as it’s already done (admin: use http basic authentication, shipping use token authentication)
  • Possibility to use the shared service manager
  • We can increase API version (with laminas api tool) module by module
  • We can use one entity manager by module

Product module architecture

Now let’s assume that the ProductA we talked about before is a Blog. This is how I would organise my module.

Instead of V1, we should get Presentation but as we use Laminas API Tools to generate the controllers, we don’t have much choice on the structure.