You are here

CertificateRouteProvider.php in Opigno certificate 8

Same filename and directory in other branches
  1. 3.x src/CertificateRouteProvider.php

File

src/CertificateRouteProvider.php
View source
<?php

namespace Drupal\opigno_certificate;

use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\Routing\AdminHtmlRouteProvider;

/**
 * Provides routes for Certificates.
 */
class CertificateRouteProvider extends AdminHtmlRouteProvider {

  /**
   * {@inheritdoc}
   */
  public function getCanonicalRoute(EntityTypeInterface $entity_type) {
    $route = parent::getCanonicalRoute($entity_type);
    $defaults = $route
      ->getDefaults();
    unset($defaults['_entity_view']);
    $defaults['_controller'] = '\\Drupal\\opigno_certificate\\Controller\\CertificateController::view';
    $route
      ->setDefaults($defaults);
    return $route;
  }

}

Classes

Namesort descending Description
CertificateRouteProvider Provides routes for Certificates.