Skip to content

Instantly share code, notes, and snippets.

@coreymcmahon
Created June 2, 2012 03:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coreymcmahon/2856438 to your computer and use it in GitHub Desktop.
Save coreymcmahon/2856438 to your computer and use it in GitHub Desktop.
Using the Symfony 2 Routing component with an in-line Controller - http://www.symfonycentral.com
<?php
// ...
$routes->add('hello', new Routing\Route('/hello/{name}', array(
'name' => 'World',
'_controller' => function ($request) {
return render_template($request);
}
)));
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment