Learn Drupal 8 using Drupal Console

By Jesus Manuel Olivas ● Head of Products | March 8th, 2015

Drupal Console has been evolving a lot since project inception back in 2013 in DrupalCamp Costa Rica.

This projects started as a scaffolding tool, to generate the necessary code to build a Drupal 8 module, and evolved as a more advanced CLI tool you can use it to interact with your Drupal 8 installation, until last week, we used to describe the project as:

A suite of tools that you run on a command line interface (CLI) to generate boilerplate code and interact with a Drupal 8 installation.

But this project description it's already obsolete, because of two new features:

#1 Verbose code-output.

This new feature will generate code adding extra information to the generated code. Think about this as the commented messages you can find on the examples module code.

How to use it?

You just need to add the --learning option when executing a generator command.

$ drupal generate:controller --learning

As writing this blog post the only command that add a verbose output is the controller generator command generate:controller.

Yes as you just saw, the messages are multi-language, and as long as you change the language on your local configuration file and the message exist on the selected language a message on the selected language will rendered.

If you not see the message on your language, feel free to help us making this tool even better, by fixing current languages or adding more at: http://bit.ly/console-translations.

Why this feature was adedd?

Drupal 8 is more technically advanced compared to its predecessors, writing a module involves a lot of boilerplate code and we want to help developers generating that code. But we do not want them to think this is some sort of black magic.

We started Drupal Console as a side-project with the purpose of learn Drupal 8. And we wanted to provide this learning capabilities but we did not have an idea how to, until receiving a request about adding this feature.

Starting with the latest release 0.7.4 Drupal Console is not longer only a tool to generate code and interact with a Drupal installation.

Drupal Console will help developers to learn Drupal 8 adding messages on the generated code, those messages are in different languages, helping them to learn Drupal 8 on their own language.

#2 GUI web site

I will not provide too many details about this feature, other than Omar Aguirre @omers is currently working to provide a GIU web-site to execute generators and provide a downloadable file containing the generated code.

I will share a couple of images provided by Omar related to this feature.

Once we fully complete these two features, our goal to provide a tool easy to use for everyone even those users not comfortable using the CLI, will be closer to be completed.

For more information related to this project you can try the following links:

As usual feel free to comment on this post or ping me at @jmolivas or @drupalconsole letting know where do you want to see this messages adding extra information on the generated code when using the --learning option.