Yogesh Chaugule's Blog


Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2405 of /var/www/html/yogeshchaugule/includes/menu.inc).

Programmatically install / uninstall module - Drupal 8

Modules are used to extend and customize Drupal Core. To install module normally we can navigate to "Admin => Extend" link in toolbar.

Like older versions of Drupal, Drupal 8 doesn't allow modules to be enable / disable. The only thing we can do is either install a module or completely uninstall it.

Below example shows how to install module using code: