1

How to share code intelligence between several blocks of the same module ? Is there a "Magento way" to do this ? or should I simply use Traits to share some functions between a given module class ?

2

You can use traits or a base block class from which you can extend your blocks or you can use a helper. In my opinion there is no a 'Magento way' of doing this. Use what suits your module better

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.