In Magento 1.x I was able to read my module's version like so:
I'm unable to figure out how I can do the same in Magento 2.0. Thanks.
You could inject Magento\Framework\Module\ModuleListInterface in to your module helper class and then have a helper function to get it. Something like;
Sorry, i haven't had time to put this in to code and test it thoroughly.
Try following way:
$moduleInfo = $this->_objectManager->get('Magento\Framework\Module\ModuleList')->getOne('SR_Learning'); // SR_Learning is module name print_r($moduleInfo);
Array ( [name] => SR_Learning [setup_version] => 2.0.0 [sequence] => Array ( ) )
It's bit different but not that hard.
All you have to do is inject the
Here is the full working code taken from https://github.com/MagePsycho/magento2-easy-template-path-hints