Themes provide the HTML, CSS, JavaScript, and other assets that are responsible for the look and feel of your site.
The Render API consists of a standard format for describing data using structured arrays and a process for converting those arrays into the HTML a user sees when interacting with a Drupal site.
Drupal Core Modules
TopicA module is a set of PHP, JavaScript, and/or CSS files that extends site features and adds functionality. The Drupal core software comes with a set of modules that provide a range of features.
Drupal's Entity API
CourseDrupal Module Development
CourseWeek 1: Setup
CourseWeek 2: Create a New Theme
CourseWeek 3: Add an Asset Library
CourseThis tutorial is for PHP developers—including Drupal 7 developers—who want to get a local development environment up and running for Drupal 8 development work. In this tutorial, we will install Drupal 8, fire up the built-in PHP web server, set some variables in php.ini, initialize a Git repository, and discuss how Composer will impact what you commit to Git now and in the future. Finally, we'll walk through how to configure PhpStorm for Symfony development that plays nicely with Drupal 8 projects as well.
Additional resources
Development Environments
Local Development Guide (drupal.org)
PhpStorm
The Wonderful World of Composer — Drupalize.Me
PHP's Built-in web server (manual) — php.net
In this tutorial, we'll create a new module and create a route and controller for it. Remember hook_menu
? Well, hook_menu
is out and routes and controllers are in! If the YAML files in this lesson piqued your interest, check out our introduction to YAML tutorial to learn more.
Note: See Create an Info File for a Module for up-to-date instructions on info file requirements, which have changed since this video was recorded.
Additional resources
Create an Info File for a Module
An Introduction to YAML — Drupalize.Me
PHP Namespaces in 120 seconds
Clear Drupal's Cache
In this tutorial, we'll use an essential tool for Drupal 8 development: the Drupal Console. We'll take a look at how to list the commands available in Drupal Console and then use a Drupal Console command to clear the route cache.
Note: See the Drupal Console docs "Getting the project" page for the latest information on how to install Drupal Console. You will need to use Composer to install Drupal Console for each project.
Additional resources
Drupal Console — Download and Documentation
Drupal Console: Getting the Project
Tutorial: Drupal Console (Drupalize.Me)
Composer
In this tutorial, you will learn how to return a response through a controller using route wildcards. We'll walk through how the wildcard in the route was created and then how this wildcard gets passed as a parameter to the controller function, enabling you to display a value to the page based on the value in a particular URL path segment using Symfony's Response object.
We're assuming you have the Drupal Console up and running (which we set up in the previous tutorial). The drupal
command calls Drupal Console.
Curious about the inner workings of the HTTP response? Dive into Symfony and HTTP Fundamentals, which takes you from HTTP fundamentals to how PHP handles HTTP requests and responses, and integrates what Symfony's tools bring to this flow from request to response.
Additional resources
Symfony and HTTP Fundamentals — Symfony Documentation
Http Foundation Response Object — Symfony Documentation
In this tutorial, you'll learn how to turn on debugging tools through changing values in local.settings.php and then use these tools with the Drupal Console.
We're assuming you have the Drupal Console up and running (which we set up in the previous tutorial). The drupal
command calls Drupal Console.
Additional resources
In this tutorial, we'll continue to look under the hood of Drupal 8, this time using a tool bundled with Devel called Webprofiler. You'll learn how to use the web debug toolbar and the profiler. You'll also learn how to reverse engineer a page to find out the names of the controllers responsible for output on that page.
Note: Webprofiler is now a separate project from Devel but still has it as a dependency.
Note: In order to get the Webprofiler timeline view working you need to add some configuration to your settings.php file. See the README.md file included with the Webprofiler module for more information on how to do this.
Additional resources
In this tutorial, we'll shift gears from routes and controllers to services. First off, you'll learn all about the Service Container, also known as the Dependency Injection Container. This is the basis for understanding these special objects called services and how you can leverage them in Drupal.
Additional resources
In this tutorial, you'll learn how to refactor the controller and create a service.
Additional resources
Dependency Injection and the Art of Services and Containers — Drupalize.Me