Helper

1 Posts
When Should I Use Magento 2 Helpers?
Technology-Strategy
Feb 6, 2017
3 minutes

When Should I Use Magento 2 Helpers?

One of the objects that developers familiar with Magento 1 will instantly recognize are helpers. When working with Magento 1, helpers proved to be a special type of object that looked similar in invocation to a singleton, but in reality it was more of a lazy way to share functionality between multiple locations. The main benefit to using a helper in Magento 1 is that it made it easier to access the __ function for translations and it was directly accessible from the template files .phtml. I’m sure many of you can relate to accessing a helper with the familiar Mage::helper('modulename');.