WebformOptionsLimitRouteSubscriber.php in Webform 6.x
Same filename and directory in other branches
Namespace
Drupal\webform_options_limit\RoutingFile
modules/webform_options_limit/src/Routing/WebformOptionsLimitRouteSubscriber.phpView source
<?php
namespace Drupal\webform_options_limit\Routing;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
/**
* Remove webform options limit routes.
*/
class WebformOptionsLimitRouteSubscriber extends RouteSubscriberBase {
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected $moduleHandler;
/**
* Constructs a WebformSubmissionLogRouteSubscriber object.
*
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler.
*/
public function __construct(ModuleHandlerInterface $module_handler) {
$this->moduleHandler = $module_handler;
}
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
if (!$this->moduleHandler
->moduleExists('webform_node')) {
$collection
->remove('entity.node.webform_options_limit.summary');
}
}
}
Classes
Name | Description |
---|---|
WebformOptionsLimitRouteSubscriber | Remove webform options limit routes. |