Showing posts with label Power of Drupal console. Show all posts
Showing posts with label Power of Drupal console. Show all posts

Monday, May 22, 2017

Create custom module in Drupal 8 via Drupal console

Generate module 
 drupal generate:module - It will ask the module name and basic information.

Give the module a name of module (welcome) and Enter module description, path and basic information. Then drupal will create the below files under the your custom module.

composer.json
welcome.info.yml
welcome.module

Install module

The module now exists but it is not enabled. You don’t need to go to the module page to enable it, you can install and enable the welcome module using the module:install command:

drupal module:install welcome

This will install the module and automatically rebuild the cache.