GithubHelp home page GithubHelp logo

drupal10's Introduction

Drupal 10 Module Development

This is the code repository for the book Drupal 10 Module Development published by Packt.

Get up and running with building powerful Drupal modules and applications

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

hello_world.hello:
  path: '/hello'
  defaults:
    _controller:  Drupal\hello_world\Controller\HelloWorldController::helloWorld
    _title: 'Our first route'
  requirements:
    _permission: 'access content'

Following is what you need for this book: If you are a Drupal developer looking to learn Drupal 10 to write modules for your sites, this book is for you. Drupal site builders and PHP developers with basic object-oriented programming skills will also find this book helpful. Although not necessary, some Symfony experience will help with understanding concepts easily.

With the following software and hardware list you can run all code files present in the book (Chapter 1-18).

Setup

To set up a local development environment, perform the following:

  1. Run the following commands:
$ docker-compose up -d
$ docker-compose exec php composer install
$ docker-compose exec php ./vendor/bin/run drupal:site-install
  1. Go to http://localhost:8080 and you have a Drupal site running. To log in, use admin / admin.

Modules

The modules covered in the book are found inside the packt folder in the root of the project. These are duplicated in each chapter and are individually symlinked in the Drupal custom module folder.

By default, when setting up the project, the chapter 2 modules are symlinked. You can change this by creating a local runner.yml file and overriding the chapter value that is used in the symlink (check the default in the runner.yml.dist file).

Once that is done, you can run the following command to symlink the right modules:

$ docker-compose exec php ./vendor/bin/run drupal:module-setup

Mails

All outgoing sent using the native PHP mailer are caught using Mailhog. You can access the emails at http://localhost:8025.

Tests

Run tests as follows:

$ docker-compose exec -u www-data php ./vendor/bin/phpunit

This will run all the tests in the configured packt modules.

Coding standards

To run the coding standards check, use this command:

$ docker-compose exec php ./vendor/bin/run drupal:phpcs

And this command to try to automatically fix coding standards issues that pop up:

$ docker-compose exec php ./vendor/bin/run drupal:phpcbf

Get to Know the Author

Daniel Sipos is a senior web developer specializing in Drupal. He's been working with Drupal sites since version 6, and started out, like many others, as a site builder. He's a self-taught programmer with many years' experience working professionally on complex Drupal 7 and 8 projects. In his spare time, he runs webomelette.com, a Drupal website where he writes technical articles, tips, and techniques related to Drupal development.

drupal10's People

Contributors

upchuk avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.