Create a simple module for Drupal 8 - Step 1 | Drupal 8

Create a simple module for Drupal 8 - Step 1

Submitted by editor on Fri, 11/13/2015 - 18:44
Question

How to create a simple module with Drupal 8

Module name : Test

Step 1. Create the module folder on module/custom directory
Exemple : module/custom/test

Step 2. Create info file on the root of the module folder (module/custom/test/test.info.yml) and configure. File name must be ModuleName.info.yml
Exemple :
name: Test Module
description: 'Short description'
type: module
core: 8.x
version: TheVersion

Step 3. Activate the module
OnĀ  admin/modules
Or using drush en test -y

Note : Here the minimum to create a module

File

Comments

hasan.raza90

Thu, 06/15/2017 - 14:27

I like it, you have explained very nicely.

Adam Borecki (not verified)

Tue, 10/03/2017 - 02:19

the example says "varsion" but I think it's supposed to say "version"

Omar (not verified)

Fri, 04/09/2021 - 08:48

Thanks for your tutorial. i have a small question in this way block is created and by manually we can assign to any region from structure > block layout
but can we do this also via programming how please guide me how we can assign block to region automatically soon after we created the block from custom module

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.