4
Mage::getDesign()->getTheme('frontend')

Just wondering if there is an equivalent of theme name in Magento 2?

1
  • You want to get current theme name? Commented Jan 4, 2017 at 9:57

1 Answer 1

1

You can use \Magento\Framework\View\DesignInterface:

/** @var \Magento\Framework\View\DesignInterface $design **/

$design->getDesignTheme();

See more app/etc/di.xml

<preference for="Magento\Framework\View\DesignInterface" type="Magento\Theme\Model\View\Design\Proxy" />
1
  • 1
    Great tip mate. Was able to get the code by using your suggestion: $design->getDesignTheme()->getCode();
    – Myk
    Commented Jan 5, 2017 at 10:28

Your Answer

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

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