Every modern framework nowadays provides a scaffolding tool code generator for speeding up the process of starting a new project and avoid early repetitive tasks.
The purpose of this project is to leverage the Symfony Console Component to provide a CLI tool to automate the creation of drupal 8 modules by generating the directory structure for a module, routing, controllers, forms, services, plugins and required configuration files.
It supports adding services using Dependency Injection on class generation.
- Generates module and info files.
- Generates PSR-4 compliant directory structure for a module.
- Register routes on YML files and map to controller and form PHP Classes.
- Create classes adding namespaces, uses and also the extend and implements keywords when required.
- Support adding services using Dependency Injection on class generation.
-
Module Maintainers & Developers
Create & Migrate contributed modules to Drupal 8. -
Drupal Trainers & Consultors
Train developers on Drupal 8. -
Drupal Shops
Reduce module development time for Drupal 8.
There are two options to install the console. The first one is using Composer and install the project as a module.
Optionally you can install componser inside Drupal Installation.
$ cd path/to/drupal8.dev
$ curl -sS https://getcomposer.org/installer | php
Instructions to install Drupal Console if you are using a local version of Composer
$ COMPOSER_BIN_DIR=bin php composer.phar require --dev drupal/console:~0.1
$ ./bin/console --help
Instructions to install Drupal Console if you are using composer globally.
$ COMPOSER_BIN_DIR=bin composer require --dev drupal/console:~0.1
$ ./bin/console --help
To create a package for Drupal Console as a .phar
file, you have to clone this repo as a separate project and run the following commands.
$ COMPOSER_BIN_DIR=bin composer require --dev drupal/console:dev-master
$ ./bin/console --help
In both versions of installer is required to use the the Composer variable COMPOSER_BIN_DIR to indicate where will be located the binary files of packages required by Drupal Console.
$ curl -s http://box-project.org/installer.php | php
$ box.phar build -v
Copy console.phar
to the root of your Drupal project and instead of ./bin/console
use php console.phar
.
$ ./bin/console generate:module
$ ./bin/console generate:controller
$ ./bin/console generate:form
$ ./bin/console generate:command
$ ./bin/console generate:service
$ ./bin/console generate:plugin:block
Introducing the Drupal 8 Console scaffolding module generator
How to install & use youtube video no audio