1

I would like to know if it's mandatory to create a module whenever we need to add some functionality to Magento even for one block for example, and what is the best way to organize them locally ? The organization is very important.

Exemple :

  • I have to add one block, one template to manage some custom view.

  • I have to add one controller, one block, one template to manage promotions.

  • I have to add an upgrade script to create some attribute.

Now, as they are a small modules, is it worth creating a module for each, or the better is to group the all in one module "Others" for exemple which we can put all the small additions and this avoids overloading Magento with the modules ? what do you think ?

  • Better create own module for your every scopes or else you can create one common module in the project for this small small stuffs to perform – Mujahidh Feb 3 '17 at 6:10
  • Of course, i'm talking about one project, all this in one magento. – PЯINCƏ Feb 3 '17 at 6:15
1

Although it is advisable to create a new module for each individual functionality, but I would suggest to create a single module for managing such small multiple functionalities.

Reason:

Whenever a page renders, Magento checks for module configuration for all enabled modules and then checks layout XML file of all those modules to collect layout handles which are related to that particular page (controller's action).

As the number of modules increase, overhead of collecting layout handles from all modules increases.

So if the required functionality is relatively small, try to merge these into single module and use meaningful names of controllers, blocks etc. to identify which file is related to which functionality.

I hope I was able to clarify my point.

Please let me know if you have any question.

  • Thank you @Mohit Kumar Arora for your time, have you some exemples of names modules merge please ? i think about other, plus, mix – PЯINCƏ Feb 3 '17 at 11:26
  • Sorry, I could not understand. Please clarify a bit more about your previous query. – Mohit Kumar Arora Feb 3 '17 at 12:11
  • No, it is a rather trivial matter. I wanted to know if you have some examples of explicit module names for merge modules. Just to have an idea. I created a merge module and I named it "other" but this name other i think that its note explicit what do you think ? – PЯINCƏ Feb 3 '17 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.