how create modules, controllers, plugin block drupal 8.54






i recomend use a docker-compose with drupal what have configuration ready to create modules

if you use native apache run install composer and install drupal console with


  • Download composer
    Terminal:
    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  • Install Composer
    Terminal:
    php composer-setup.php
  • Copy composer to local bin
    Terminal:
    cp -a composer.phar /usr/local/bin/composer
  • Install git
    Terminal:
    apt-get update -y && apt-get install git-core -y

  • Install console with composer
  • Terminal:
    composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader
  • Install drush with composer
  • Terminal:
    composer global require drush/drush && \
        composer global update

or with docker easy run that install whole before
Terminal:
sudo docker-compose up




now run this

Use this command:

Terminal:
vendor/bin/drupal generate:module


For generate a controller:
Terminal:
vendor/bin/drupal generate:controller


for generate plugin block:
Terminal:
vendor/bin/drupal generate:plugin:block
Remenber write to name module






0 comentarios :