You are here

public function SmartDateFormatHtmlRouteProvider::getRoutes in Smart Date 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Entity/SmartDateFormatHtmlRouteProvider.php \Drupal\smart_date\Entity\SmartDateFormatHtmlRouteProvider::getRoutes()
  2. 8 src/Entity/SmartDateFormatHtmlRouteProvider.php \Drupal\smart_date\Entity\SmartDateFormatHtmlRouteProvider::getRoutes()
  3. 3.x src/Entity/SmartDateFormatHtmlRouteProvider.php \Drupal\smart_date\Entity\SmartDateFormatHtmlRouteProvider::getRoutes()
  4. 3.1.x src/Entity/SmartDateFormatHtmlRouteProvider.php \Drupal\smart_date\Entity\SmartDateFormatHtmlRouteProvider::getRoutes()
  5. 3.2.x src/Entity/SmartDateFormatHtmlRouteProvider.php \Drupal\smart_date\Entity\SmartDateFormatHtmlRouteProvider::getRoutes()
  6. 3.3.x src/Entity/SmartDateFormatHtmlRouteProvider.php \Drupal\smart_date\Entity\SmartDateFormatHtmlRouteProvider::getRoutes()
  7. 3.4.x src/Entity/SmartDateFormatHtmlRouteProvider.php \Drupal\smart_date\Entity\SmartDateFormatHtmlRouteProvider::getRoutes()

Provides routes for entities.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type

Return value

\Symfony\Component\Routing\RouteCollection|\Symfony\Component\Routing\Route[] Returns a route collection or an array of routes keyed by name, like route_callbacks inside 'routing.yml' files.

Overrides DefaultHtmlRouteProvider::getRoutes

File

src/Entity/SmartDateFormatHtmlRouteProvider.php, line 20

Class

SmartDateFormatHtmlRouteProvider
Provides routes for Smart date formats.

Namespace

Drupal\smart_date\Entity

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  $collection = parent::getRoutes($entity_type);
  $entity_type_id = $entity_type
    ->id();
  if ($settings_form_route = $this
    ->getSettingsFormRoute($entity_type)) {
    $collection
      ->add("{$entity_type_id}.settings", $settings_form_route);
  }
  return $collection;
}