diff core/lib/Drupal/Core/Controller/ControllerResolverInterface.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/lib/Drupal/Core/Controller/ControllerResolverInterface.php	Wed Nov 29 16:09:58 2017 +0000
@@ -0,0 +1,32 @@
+<?php
+
+namespace Drupal\Core\Controller;
+
+use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface as BaseControllerResolverInterface;
+
+/**
+ * Extends the ControllerResolverInterface from symfony.
+ */
+interface ControllerResolverInterface extends BaseControllerResolverInterface {
+
+  /**
+   * Returns the Controller instance with a given controller route definition.
+   *
+   * As several resolvers can exist for a single application, a resolver must
+   * return false when it is not able to determine the controller.
+   *
+   * @param mixed $controller
+   *   The controller attribute like in $request->attributes->get('_controller')
+   *
+   * @return mixed|bool
+   *   A PHP callable representing the Controller, or false if this resolver is
+   *   not able to determine the controller
+   *
+   * @throws \InvalidArgumentException|\LogicException
+   *   Thrown if the controller can't be found.
+   *
+   * @see \Symfony\Component\HttpKernel\Controller\ControllerResolverInterface::getController()
+   */
+  public function getControllerFromDefinition($controller);
+
+}