public function RulesUiRouteEnhancer::enhance in Rules 8.3
File
- src/
Routing/ RulesUiRouteEnhancer.php, line 42
Class
- RulesUiRouteEnhancer
- Enhances routes with the specified RulesUI.
Namespace
Drupal\rules\RoutingCode
public function enhance(array $defaults, Request $request) {
/** @var \Symfony\Component\Routing\Route $route */
$route = $defaults[RouteObjectInterface::ROUTE_OBJECT];
if ($plugin_id = $route
->getOption('_rules_ui')) {
$defaults['rules_ui_handler'] = $this->rulesUiManager
->createInstance($plugin_id);
}
return $defaults;
}