class ContactRouteProvider in Contact Storage 8
Provides routes for contact messages and contact forms.
Hierarchy
- class \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider implements EntityHandlerInterface, EntityRouteProviderInterface
- class \Drupal\contact_storage\ContactRouteProvider
Expanded class hierarchy of ContactRouteProvider
File
- src/
ContactRouteProvider.php, line 12
Namespace
Drupal\contact_storageView source
class ContactRouteProvider extends DefaultHtmlRouteProvider {
/**
* {@inheritdoc}
*/
public function getRoutes(EntityTypeInterface $entity_type) {
$route_collection = parent::getRoutes($entity_type);
if ($entity_type
->hasLinkTemplate('collection')) {
$route = (new Route($entity_type
->getLinkTemplate('collection')))
->addDefaults([
'_entity_list' => 'contact_message',
'_title' => 'Contact messages',
])
->addRequirements([
'_permission' => 'administer contact forms',
]);
$route_collection
->add('entity.' . $entity_type
->id() . '.collection', $route);
}
if ($entity_type
->hasLinkTemplate('clone-form')) {
$route = (new Route($entity_type
->getLinkTemplate('clone-form')))
->addDefaults([
'_entity_form' => 'contact_form.clone',
'_title' => 'Clone form',
])
->addRequirements([
'_entity_access' => 'contact_form.clone',
]);
$route_collection
->add('entity.' . $entity_type
->id() . '.clone_form', $route);
}
return $route_collection;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContactRouteProvider:: |
public | function |
Provides routes for entities. Overrides DefaultHtmlRouteProvider:: |
|
DefaultHtmlRouteProvider:: |
protected | property | The entity field manager. | |
DefaultHtmlRouteProvider:: |
protected | property | The entity type manager. | |
DefaultHtmlRouteProvider:: |
public static | function |
Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface:: |
1 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the add-form route. | 2 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the add page route. | 2 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the canonical route. | 3 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the collection route. | 2 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the delete-form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Returns the delete multiple form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the edit-form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the type of the ID key for a given entity type. | 1 |
DefaultHtmlRouteProvider:: |
public | function | Constructs a new DefaultHtmlRouteProvider. | 1 |