You are here

class FormRouteEnhancer in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php \Drupal\Core\Routing\Enhancer\FormRouteEnhancer

Enhancer to add a wrapping controller for _form routes.

Hierarchy

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
route_enhancer.form in core/core.services.yml
Drupal\Core\Routing\Enhancer\FormRouteEnhancer

File

core/lib/Drupal/Core/Routing/Enhancer/FormRouteEnhancer.php, line 16
Contains \Drupal\Core\Routing\Enhancer\FormRouteEnhancer.

Namespace

Drupal\Core\Routing\Enhancer
View 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

Namesort descending Modifiers Type Description Overrides
FormRouteEnhancer::applies public function Declares if the route enhancer applies to the given route. Overrides RouteEnhancerInterface::applies
FormRouteEnhancer::enhance public function Update the defaults based on its own data and the request. Overrides RouteEnhancerInterface::enhance