Content CRUD forms.
One of the major benefits of using a CMS is that you can define your data structure and have your create, edit, update, and delete forms generated automatically. This saves you time if you were coding an application from the ground up.
Form handlers in the entity annotation define which class to use. Links define the urls where these forms will be shown.
handlers = {
"storage" = "Drupal\Core\Entity\Sql\SqlContentEntityStorage",
"list_builder" = "Drupal\code_sample\CodeSampleListBuilder",
"view_builder" = "Drupal\code_sample\CodeSampleViewBuilder",
"route_provider" = {
"default" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
},
"form" = {
"default" = "Drupal\code_sample\Form\CodeSampleForm",
"edit" = "Drupal\code_sample\Form\CodeSampleForm",
},
},
links = {
"canonical" = "/code-sample/{code_sample}",
"edit-form" = "/code-sample/{code_sample}/edit",
"delete-form" = "/code-sample/{code_sample}/delete",
"view" = "/code-sample/{code_sample}",
"edit" = "/code-sample/{code_sample}/edit",
"delete" = "/code-sample/{code_sample}/delete",
},
See ContentEntityForm, EntityForm, ConfigurationForm.