Magento 2

Call helper from template magento 2

$this->helper('[Vendor]\[Module]\Helper\[Helper Name]');

or 

 

Roll your own factory:

$objectManager = \Magento\Core\Model\ObjectManager::getInstance();

$helperFactory = $objectManager->get('\Magento\Core\Model\Factory\Helper');

$helper = $helperFactory->get('\PulseStorm\Commercebug\Helper\Data');

Or just grab it directly:

 

$helper = \Magento\Core\Model\ObjectManager::getInstance()->get('Magento\Core\Helper\Data')

1 Bình luận

  1. choice nói:

    good choice real cialis is a br and for a medicament titled Cialis.

Trở về
  • Magento plug-ins
  • Magento plug-ins

    Magento2 gave very good concept called Plugin   we can do what ever after and before core function and also we have...

  • HOW TO CREATE MENU IN MAGENTO 2 ADMIN
  • HOW TO CREATE MENU IN MAGENTO 2 ADMIN

    magento-2-admin- menu My previous tutorial show you how to create a simple module in Magento 2, learn more here: http://www.venustheme.com/how-to-create-magento-2-module/....