You are here

14 November 2013

Installing module programmatically in Drupal 7 can be achieved with just one step, using module_enable function.

Source code viewer
  1. // Array of module machine names.
  2. $modules = array('module1', 'module2');
  3. // Whether or not to enable dependant modules.
  4. $dependencies = TRUE;
  5.  
  6. module_enable($modules, $dependencies);
Programming Language: PHP