Skip to content

Instantly share code, notes, and snippets.

@ravenberg
Created November 8, 2015 15:51
Show Gist options
  • Save ravenberg/2ff1a26869539bcce31e to your computer and use it in GitHub Desktop.
Save ravenberg/2ff1a26869539bcce31e to your computer and use it in GitHub Desktop.
Symfony routing: annotations
<?php
namespace Laurora\HelloWorldBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class DefaultController extends Controller
{
/**
* @Route("/{name}", defaults={"name"="Lee"})
* @Template()
*/
public function indexAction($name)
{
return array('name' => $name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment