December 2016
Beginner to intermediate
1005 pages
21h 54m
English
In this recipe, we will create a form, which will be accessible from a menu path. This will involve creating a route that tells Drupal to invoke our form and display it to the end user.
Forms are defined as classes, which implement \Drupal\Core\Form\FormInterface. The \Drupal\Core\Form\FormBase serves as a utility class that is intended to be extended. We will extend this class to create a new form.
Since we will be writing the code, you will want to have a custom module. Creating a custom module in Drupal is simply creating a folder and an info.yml file. For this recipe, we will create a folder under /modules in your Drupal folder called drupalform.
In the drupalform folder, create drupalform.info.yml. The info.yml
Read now
Unlock full access