Skip to content

Instantly share code, notes, and snippets.

@digitalkaoz
Created September 11, 2015 08:01
Show Gist options
  • Save digitalkaoz/ac663650fc6131d295ac to your computer and use it in GitHub Desktop.
Save digitalkaoz/ac663650fc6131d295ac to your computer and use it in GitHub Desktop.
Symfony Closure Controller
<?php
$routes = new RouteCollection();
$controller = function(Request $request) {
return new Response('foo');
};
$route = new Route('/foo', ['_controller' => $controller]);
$routes->add('foo_route', $route);
@digitalkaoz
Copy link
Author

throws
UndefinedMethodException in appDevUrlMatcher.php line xxx: Attempted to call an undefined method named "__set_state" of class "Closure".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment