O'Reilly logo

Drupal 8: Enterprise Web Development by Chaz Chumley, Matt Glaman, Richard Jones, Nick Abbott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Processing submitted form data

A form's purpose is to collect data and do something with the data that was submitted. All forms need to implement the \Drupal\Core\Form\FormInterface. The interface defines a submit method. Once the Form API has invoked the class's validation method, the submit method can be run.

This recipe will be based on the custom module and form created in the Creating a form recipe of this chapter. We will convert the form to \Drupal\Core\FormConfigBaseForm, allowing easy storage of the field element.

Getting ready

In this recipe, we will be using the module and custom form created in the first Creating a form recipe.

How to do it…

  1. In your module's directory, create a config directory, and then create a directory inside it named ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required