-
Notifications
You must be signed in to change notification settings - Fork 0
drupal module
Paulo Maia Carvalho edited this page May 20, 2026
·
1 revision
Scaffold a new custom Drupal module with the standard boilerplate file structure.
/drupal-module my_module
/drupal-module name=my_module
If you don't provide a name, the agent suggests one and confirms with you.
web/modules/custom/my_module/
├── my_module.info.yml
├── my_module.module
├── my_module.routing.yml
├── my_module.services.yml
└── src/
└── Controller/
└── MyModuleController.php
name: 'My Module'
type: module
description: 'Description of my module.'
package: Custom
core_version_requirement: ^10 || ^11
dependencies: []Includes a sample route pointing to the controller.
A minimal controller extending ControllerBase with a single action method returning a render array.
The agent runs drush en my_module to enable the module and then drush cr to rebuild caches.
- Converted to snake_case automatically (hyphens → underscores, lowercase)
- Must start with a letter
- Must not conflict with existing core or contrib module names (checked against installed packages)
- drupal-install — install a contrib module instead
- drupal-analyze — lint your new module
- drupal-cr — rebuild caches after changes