Drupal console, like symfony console, provides dozens of commands for generating modules and boilerplate code in the Drupal ecosystem, including the following.:
Generate a module
|
|
If you don’t already have a directory, this command will create one for you.
Generate services
|
|
Generate a controller
|
|
If your service depends on another services when you prompt with Enter your service []: enter the name of the dependencies services and press enter for example helloworld.fancy_logger, that will do a couple of things:
- Add the dependency in the argument [] section of the service declaration in the service.yaml.
- And injects the said service class/ interface in the constructor.