0

I want all information about the theme in my module code how can I grab the theme information.The Theme that I have in my Magento like WordPress we can get all the themes information is it possible here.

This example is useful for magento 1.X what about magento 2.

Mage::getSingleton('core/design_package')->getPackageList(); Mage::getSingleton('core/design_package')->getThemeList();

  • this is a bit unclear. What information you want about the theme? Give an example – Marius Jul 21 '16 at 6:16
  • @Marius I want theme name and version and all this and i want this info in my module – Ankush Chauhan Jul 21 '16 at 6:28
  • i want to do same thing in magento 2 – Ankush Chauhan Jul 21 '16 at 10:27
1

I know it's an old question, but since I was looking for the same thing, for future visitors:

use Magento\Framework\View\Design\Theme\ListInterface;

...

public function __construct(
    ListInterface $themeList
) {
    $this->themeList = $themeList;
}

public function getThemes()
{
    foreach ($this->themeList as $theme) {
        /** @var \Magento\Theme\Model\Theme $theme */
        // do things
    }
}

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.