Drupal Console

The Drupal Console is a suite of tools that you run on a command line interface (CLI) to generate boilerplate code and interact with a Drupal 8 installation. For earlier versions of Drupal, see drush-related coder module tools.



Getting Started - Background & Prerequisites (Drupal 8)

Drupal 8 leverages a number of advanced PHP language features and sophisticated 3rd party libraries in order to present 3rd party developers with the most advanced API of any CMS available. While experienced Drupal 7 developers may see some significant changes, much of the basic structure will remain familiar.

D7 to D8 upgrade: fields, widgets and formatters

Why not try the example module explained on this page yourself? Download

For fields, their widgets and their formatters, hook-implementations in D7 are replaced by classes with annotations in D8. For instance, the schema definition that used to live in the .install file has moved to the class that lives in modulename/lib/Drupal/modulename/Plugin/Field/FieldType/ModuleNameItem.php. So often, after upgrading your project won't have a .install file anymore.

Here's in summary what you'll have to add to re-instate the functionality provided by your field hook implementations.
In the /modules/modulename/lib/Drupal/modulename/Plugin/Field folder you need to create the 3 following files, each holding a class and its magic annotations.

  • .../FieldType/ModuleNameItem.php
  • .../FieldWidget/ModuleNameWidget.php
  • .../FieldFormatter/ModuleNameFormatter.php

Below are examples of the files above, plus .info.yml and .module files that when put together form a working example of a module that programmatically creates a text field, widget and formatter. Through the "Manage fields" UI this field may be attached to any entity type.

Contributing to Symfony Documentation

THIS PAGE IS A WORK IN PROGRESS... It should have more information shortly!

This document covers updating documentation (online and API) for the Symfony component of Drupal (adopted in Drupal version 8).

Background and Overview

In Drupal version 8, the Drupal Core project adopted several third-party libraries into its source code, including the Symfony web development framework. The Symfony library is under directory core/vendor/symfony in the Drupal core source code (version 8), and other PHP-based libraries are in other directories under core/vendor. There are also third-party JavaScript libraries in Drupal, such as JQuery (which has been part of Drupal for many versions); these have traditionally been located in the "misc" directory, mixed in with Drupal-native JavaScript libraries.

If you find an error or omission in Symfony's documentation and would like to contribute to the Drupal and Symfony projects by fixing it (or at least pointing it out), the basic steps are the same as contributing to the Drupal API documentation:

Subscribe with RSS Subscribe to RSS - symfony