class VocabularyRouteProvider

Same name and namespace in other branches
  1. 9 core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php \Drupal\taxonomy\Entity\Routing\VocabularyRouteProvider
  2. 8.9.x core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php \Drupal\taxonomy\Entity\Routing\VocabularyRouteProvider
  3. 11.x core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php \Drupal\taxonomy\Entity\Routing\VocabularyRouteProvider

Hierarchy

Expanded class hierarchy of VocabularyRouteProvider

File

core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php, line 9

Namespace

Drupal\taxonomy\Entity\Routing
View source
class VocabularyRouteProvider extends AdminHtmlRouteProvider {
  
  /**
   * {@inheritdoc}
   */
  public function getRoutes(EntityTypeInterface $entity_type) {
    $collection = parent::getRoutes($entity_type);
    if ($reset_page_route = $this->getResetPageRoute($entity_type)) {
      $collection->add("entity.taxonomy_vocabulary.reset_form", $reset_page_route);
    }
    if ($overview_page_route = $this->getOverviewPageRoute($entity_type)) {
      $collection->add("entity.taxonomy_vocabulary.overview_form", $overview_page_route);
    }
    return $collection;
  }
  
  /**
   * Gets the reset page route.
   *
   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
   *   The entity type.
   *
   * @return \Symfony\Component\Routing\Route|null
   *   The generated route, if available.
   */
  protected function getResetPageRoute(EntityTypeInterface $entity_type) {
    $route = new Route('/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/reset');
    $route->setDefault('_entity_form', 'taxonomy_vocabulary.reset');
    $route->setDefault('_title', 'Reset');
    $route->setRequirement('_entity_access', 'taxonomy_vocabulary.reset all weights');
    $route->setOption('_admin_route', TRUE);
    $route->setOption('parameters', [
      'taxonomy_vocabulary' => [
        'with_config_overrides' => TRUE,
      ],
    ]);
    return $route;
  }
  
  /**
   * Gets the overview page route.
   *
   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
   *   The entity type.
   *
   * @return \Symfony\Component\Routing\Route|null
   *   The generated route, if available.
   */
  protected function getOverviewPageRoute(EntityTypeInterface $entity_type) {
    $route = new Route('/admin/structure/taxonomy/manage/{taxonomy_vocabulary}/overview');
    $route->setDefault('_title_callback', '\\Drupal\\Core\\Entity\\Controller\\EntityController::title');
    $route->setDefault('_form', 'Drupal\\taxonomy\\Form\\OverviewTerms');
    $route->setRequirement('_entity_access', 'taxonomy_vocabulary.access taxonomy overview');
    $route->setOption('_admin_route', TRUE);
    $route->setOption('parameters', [
      'taxonomy_vocabulary' => [
        'with_config_overrides' => TRUE,
      ],
    ]);
    return $route;
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AdminHtmlRouteProvider::getAddFormRoute protected function Overrides DefaultHtmlRouteProvider::getAddFormRoute
AdminHtmlRouteProvider::getAddPageRoute protected function Overrides DefaultHtmlRouteProvider::getAddPageRoute
AdminHtmlRouteProvider::getDeleteFormRoute protected function Overrides DefaultHtmlRouteProvider::getDeleteFormRoute
AdminHtmlRouteProvider::getDeleteMultipleFormRoute protected function Overrides DefaultHtmlRouteProvider::getDeleteMultipleFormRoute
AdminHtmlRouteProvider::getEditFormRoute protected function Overrides DefaultHtmlRouteProvider::getEditFormRoute
DefaultHtmlRouteProvider::$entityFieldManager protected property The entity field manager.
DefaultHtmlRouteProvider::$entityTypeManager protected property The entity type manager.
DefaultHtmlRouteProvider::createInstance public static function Overrides EntityHandlerInterface::createInstance 1
DefaultHtmlRouteProvider::getCanonicalRoute protected function Gets the canonical route. 2
DefaultHtmlRouteProvider::getCollectionRoute protected function Gets the collection route. 1
DefaultHtmlRouteProvider::getEntityTypeIdKeyType protected function Gets the type of the ID key for a given entity type. 1
DefaultHtmlRouteProvider::__construct public function Constructs a new DefaultHtmlRouteProvider. 1
VocabularyRouteProvider::getOverviewPageRoute protected function Gets the overview page route.
VocabularyRouteProvider::getResetPageRoute protected function Gets the reset page route.
VocabularyRouteProvider::getRoutes public function Overrides DefaultHtmlRouteProvider::getRoutes

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.