What functionality should be included in the Zend Framework modules?

I am a little puzzled by the Zend Framework modules. I mean - I understand that you would usually like to have an interface and a backend module ... right?

But - What else would you divide into modules?

can someone who uses the Zend Framework professionally give an example of what modules they have in their application?

+4
source share
2 answers

The Lingo Zend MVC module is an independent part of your application. For example, if you want to write a content management system, you will probably have different modules, for example

  • The main application (user login, application boot file, etc.).
  • The blog
  • news
  • Admin panel
  • Image Gallery

In principle, each of these modules can act as a separate application (although in the end they will be interconnected). The module approach also gives you an easy way to manage permissions (for example, users can only pay for specific modules).

+3
source

In addition to the Daffs answers, we could try to figure out some recommendations for choosing between a โ€œcontrollerโ€ or a โ€œmoduleโ€ to implement a specific set of functionality. Please help make this list exhaustive by commenting or editing:

When to use the "controller":

  • when a significant degree of dependence on different models of the same module
  • when there is a significant degree of interaction with other controllers of the same module.
  • when functionality can be covered by several methods / actions
  • when the functionality is clearly a set of subordinated functions of this module
  • when functionality can be easily preserved along with the rest of the code (version control, deployment, ...)

When to use the "module":

  • when there are no or almost no dependencies with controllers and models of the main modules.
  • when a functionality package can be considered as a separate (sub) application
  • when functionality cannot be covered by several methods / actions and therefore should be divided into several controllers.
  • when version and deployment require independence from the core module.
+2
source

Source: https://habr.com/ru/post/1333908/


All Articles