Use the following command to run the included util for creating a new module:
cd /var/www/_scripts/utils && ./create_drupal_module.sh
The following example will show you how we create a basic module:
What is the userfriendly name of the Module?
Module name: Example
Fill in a userfriendly description?
Description: Example
Would like the custom module to have a install file (YES/no)?
install file: no
Would like the custom module to have a libraries file (YES/no)?
no
Would like the custom module to have a permissions file (YES/no)?
no
Would like the custom module to have a event subscriber file (YES/no)?
no
Would like the custom module to have a block plugin file (YES/no)?
no
Would like the custom module to have a controller file (YES/no)?
no
Would like the custom module to have a settings form file (YES/no)?
no
Creating a Drupal module named 'Example'.
Welcome to d8:module:standard generator!
––––––––––––––––––––––––––––––––––––––––––
The following directories and files have been created or updated:
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
• example/example.info.yml
• example/example.module
Got to: /var/www/public/cms
Enable Drupal module 'example'
[success] Successfully enabled: example
Clear Drupal caches
[success] Cache rebuild complete.
Adding Drupal module to Git
Success!!
After this drupal will show the newly created module on the Extend page:
Additional Drupal Development Documentation: https://www.drupal.org/docs/develop
Last modified | Friday, April 30, 2021, 12:00:21 PM UTC |
Last author | Colin van Eenige |
Commit ID | 4c7a701 |