Repository URL to install this package:
|
Version:
2.0.2 ▾
|
<?php
namespace Drupal\custom_forms\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
/**
* Class RoutingSubscriber
*
* Subscribes to Drupal's routing system, allowing it to alter any routed that
* have been loaded prior to this module getting loaded.
*
* @package Drupal\custom_forms\Routing
*/
class RoutingSubscriber extends RouteSubscriberBase {
/**
* Alters existing routes for a specific collection.
*
* @param \Symfony\Component\Routing\RouteCollection $collection
* The route collection for adding routes.
*/
protected function alterRoutes(RouteCollection $collection) {
if ($route = $collection->get('entity.custom_form.clone_form')) {
$route->setDefault('_title_callback', '\Drupal\custom_forms\Controller\CustomFormController::cloneTitle');
}
}
}