Skip to main content
DrupalABC

Main navigation

  • Home
  • Search
  • Learn Drupal
  • Certifications
  • Drupal Code Finder
User account menu
  • Log in

Breadcrumb

  1. Home

How to install a module programmatically in Drupal 8?

There might be a situation when you have to install a module programmatically in Drupal 8. You can achieve this with the help of Drush Invoke command. Make sure Drush is working fine on your system before using this function.

//This command will install and enable both devel and admin toolbar.

drush_invoke('pm-enable',['devel','admin_toolbar']);

Tags
Drupal8
Drush
Disqus
DrupalABC

Footer

  • Buy me a coffee
  • Drupal.org profile
  • LinkedIn
Powered by Drupal

Drupal is a registered trademark of Dries Buytaert