You are here

class AdminCreateHtmlRouteProvider in Entity API 8.0

Provides HTML routes for creating entities using the administrative theme.

Hierarchy

Expanded class hierarchy of AdminCreateHtmlRouteProvider

File

src/Routing/AdminCreateHtmlRouteProvider.php, line 15
Contains \Drupal\entity\Routing\AdminCreateHtmlRouteProvider.

Namespace

Drupal\entity\Routing
View source
class AdminCreateHtmlRouteProvider extends CreateHtmlRouteProvider {

  /**
   * {@inheritdoc}
   */
  protected function addPageRoute(EntityTypeInterface $entity_type) {
    if ($route = parent::addPageRoute($entity_type)) {
      $route
        ->setOption('_admin_route', TRUE);
      return $route;
    }
  }

  /**
   * {@inheritdoc}
   */
  protected function addFormRoute(EntityTypeInterface $entity_type) {
    if ($route = parent::addFormRoute($entity_type)) {
      $route
        ->setOption('_admin_route', TRUE);
      return $route;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AdminCreateHtmlRouteProvider::addFormRoute protected function Returns the add form route. Overrides CreateHtmlRouteProvider::addFormRoute
AdminCreateHtmlRouteProvider::addPageRoute protected function Returns the add page route. Overrides CreateHtmlRouteProvider::addPageRoute
CreateHtmlRouteProvider::getRoutes public function Provides routes for entities. Overrides EntityRouteProviderInterface::getRoutes