Created
November 8, 2015 15:51
-
-
Save ravenberg/2ff1a26869539bcce31e to your computer and use it in GitHub Desktop.
Symfony routing: annotations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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