Hướng dẫn Generating a module and a custom form with Drupal Console

9th Aug 2021
Table of contents

Installing Drupal Console

To install Drupal Console, follow these steps:

If you have not already done so, install a Drupal 8 site. You must have a Drupal 8 site installed on your account to install Drupal Console.

Log in to your site using SSH.

At the command prompt, change the current directory to where the Drupal site is installed. For example, type

cd ~/public_html/drupal

To install Drupal Console, type the following command:

composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader

To ensure that you can run Drupal Console from any directory, type the following commands. Replace username with your account username, and replace drupal_dir with the name of the directory where you installed Drupal:

echo 'alias drupal="/home/username/public_html/drupal_dir/vendor/bin/drupal"' >> ~/.bashrc

source ~/.bashrc

You can now run Drupal Console by simply typing drupal at the command prompt from any directory in your account.

To verify that Drupal Console installed correctly, type one or both of the following commands in the Drupal site directory:

drupal site:status

drupal site:statistics

You should see information about your Drupal site.


Add new comment

Image CAPTCHA
Enter the characters shown in the image.

Related Articles

Master list (in progress) of how to get parts of fields for use in Twig templates. I’m always having to look these up, so I thought I’d hash them out and write them down.

Litespeed Cache là plugin WordPress dùng để kết hợp với Web Server LiteSpeed nhằm tăng tốc website WordPress của bạn gấp nhiều lần

In this article, we are going to see how some tools & libraries will make people's lives easier during the development & code review process.

In this tutorial, you will learn how to improve the custom code, theme and module, and general code development by using the pre-commit hook on git

Trước khi tìm hiểu xem PHP Code Sniffer là gì thì các bạn cần phải nắm được coding convention là gì đã.