commit f76039d4a45cc3ece609a01610527a1e1bc5ee86
Author: Fabien Potencier <fabien.potencier@gmail.com>
Date:   Fri Dec 28 11:41:35 2012 +0100

    -

diff --git a/core/lib/Drupal/Core/ControllerResolver.php b/core/lib/Drupal/Core/ControllerResolver.php
index abb9889..bb38dc4 100644
--- a/core/lib/Drupal/Core/ControllerResolver.php
+++ b/core/lib/Drupal/Core/ControllerResolver.php
@@ -15,9 +15,15 @@
 /**
  * ControllerResolver to enhance controllers beyond Symfony's basic handling.
  *
- * When creating a new object-based controller that implements
- * ContainerAwareInterface, inject the container into it. While not always
- * necessary, that allows a controller to vary the services it needs at runtime.
+ * It adds two behaviors:
+ *
+ *  * When creating a new object-based controller that implements
+ *    ContainerAwareInterface, inject the container into it. While not always
+ *    necessary, that allows a controller to vary the services it needs at runtime.
+ *
+ *  * By default, a controller name follows the class::method notation. This class
+ *    adds the possibility to use a service from the container as a controller by
+ *    using a service:method notation (Symfony uses the same convention).
  */
 class ControllerResolver extends BaseControllerResolver {
 
@@ -52,15 +58,30 @@ public function __construct(ContainerInterface $container, LoggerInterface $logg
    *   A PHP callable.
    */
   protected function createController($controller) {
-    $controller = parent::createController($controller);
+    // class::method
+    if (false !== strpos($controller, '::')) {
+      list($class, $method) = explode('::', $controller, 2);
+
+      if (!class_exists($class)) {
+          throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class));
+      }
+
+      $controller = new $class();
+      if ($controller instanceof ContainerAwareInterface) {
+          $controller->setContainer($this->container);
+      }
+
+      return array($controller, $method);
+    }
+
+    // service_name:method
+    if (1 == $count = substr_count($controller, ':')) {
+      // controller in the service:method notation
+      list($service, $method) = explode(':', $controller, 2);
 
-    // $controller will be an array of object and method name, per PHP's
-    // definition of a callable. Index 0 therefore is the object we want to
-    // enhance.
-    if ($controller[0] instanceof ContainerAwareInterface) {
-      $controller[0]->setContainer($this->container);
+      return array($this->container->get($service), $method);
     }
 
-    return $controller;
+    throw new \LogicException(sprintf('Unable to parse the controller name "%s".', $controller));
   }
 }
