| Drupal
build a drupal 8 module

Building modules in Drupal 8 is surprisingly easy.

With just four files, you can register the module with Drupal 8, create functionality, control permissions and add a menu link to the module.

In these four videos, taken from the "How to Develop Drupal 8 Modules" class, we're going to show how easy it is to build your first module.

All you need is a Drupal 8 site and you should be able to follow along in just a few minutes:

Video 1. Create the required module files

In this first video, you'll set up the folder and basic files needed to register your module.

Video 2. Add your first hook

In this video, you're going to implement your first hook. This hook will allow us to alter a form before it's rendered.

Video 3. Add routing 

Now that you've created a module, it's time to make it visible. In this lesson, you'll build a FirstController.php and a routing.yml file. This controller will create a page with a URL and the access permissions.

Video 4: Add a menu link

In this lesson, you'll create a new file called .links.menu.yml. This file will define the menu link so that it appears on your Drupal site.

About the author

Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.