Commandpm-enable
(alias: en
)
Syntax
drush en [project]
Example
drush en views
Drush will even automatically download any dependencies that you may be missing. When I try to enable Views, Drush will tell me that it requires ctools, and ask if I want to download it. All I have to do is type “y” and push enter, and Drush will download ctools, then pick back up where it left off, and ask if I’d like to enable views and ctools. Again, I'll type "y" and push enter.
Let's take a look in the interface to see what happened. We'll go to the modules page, and scroll down to see that "Chaos Tools" and Views" have been enabled. You'll also notice that "Views UI" is disabled. It's common to disable "UI" modules on production environments for performance reasons, but since this is a development environment, I'd like to enable it. In order to do that, we need to know Views UI's machine name.
If we head back over to the terminal, and scroll up to where we downloaded views, you'll see the line "Project views contains 2 modules: views, views_ui." This tells you that the machine name for "Views UI" is simply "views_ui". So in order to enable it, we'll type "drush en views_ui -y" (I've added the "-y" to automatically answer yes to any prompts from Drush like the questions "Would you like to download them? (y/n)" and "Do you really want to continue? (y/n)" from above. When I push enter, you'll see it happen.)
Now, we can refresh the modules page and see that Views UI is now enabled.
We can also enable multiple projects at once, the same way we downloaded multiple projects. "drush en admin_menu admin_menu_toolbar toolbar_admin_menu module_filter" will enable all of the parts of the Admin Menu, Hide The Menu and Module Filter modules that we want.