3

I am trying to get core helper in magento 2. In Magento 1, I was using -

<?php $_coreHelper = $this->helper('core');
/* @var $_coreHelper Mage_Core_Helper_Data */ ?>

Is there any way to use core helper in magento 2, like this?

1 Answer 1

3

You can do the following in your template:

$this->helper('Path/To/Helper/Class')->customMethod();

But it is not a good practice, see details here: Magento 2: proper use of helpers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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