Get module version in Prestashop

2019-08-18 16:08发布

问题:

I have a module installed on my Prestashop and I want to get its version

How can I do this in my code ?

Let's say for example I want to get "v5.0.1"

Thanks for the help !

回答1:

$module = Module::getInstanceByName('bienvenue');
$version = $module->version;


回答2:

The version is set in the module file like that:

public function __construct()
{
    $this->name = 'bienvenue';
    $this->version = '5.0.1';

    parent::__construct();

    /* Else code... */
}


标签: prestashop