class FormRouteEnhancer in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php \Drupal\Core\Routing\Enhancer\FormRouteEnhancer
Enhancer to add a wrapping controller for _form routes.
Hierarchy
- class \Drupal\Core\Routing\Enhancer\FormRouteEnhancer implements RouteEnhancerInterface
Expanded class hierarchy of FormRouteEnhancer
1 string reference to 'FormRouteEnhancer'
- core.services.yml in core/
core.services.yml - core/core.services.yml
1 service uses FormRouteEnhancer
File
- core/
lib/ Drupal/ Core/ Routing/ Enhancer/ FormRouteEnhancer.php, line 16 - Contains \Drupal\Core\Routing\Enhancer\FormRouteEnhancer.
Namespace
Drupal\Core\Routing\EnhancerView source
class FormRouteEnhancer implements RouteEnhancerInterface {
/**
* {@inheritdoc}
*/
public function applies(Route $route) {
return $route
->hasDefault('_form') && !$route
->hasDefault('_controller');
}
/**
* {@inheritdoc}
*/
public function enhance(array $defaults, Request $request) {
$defaults['_controller'] = 'controller.form:getContentResult';
return $defaults;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FormRouteEnhancer:: |
public | function |
Declares if the route enhancer applies to the given route. Overrides RouteEnhancerInterface:: |
|
FormRouteEnhancer:: |
public | function |
Update the defaults based on its own data and the request. Overrides RouteEnhancerInterface:: |