From fb9d4195fa70cd4d695f7ec76c91acf20dbc28c8 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Tue, 24 Mar 2015 17:18:34 +0100 Subject: [PATCH] Use Symfony's template controller --- app/config/routing.yml | 9 ++++++ .../Controller/DefaultController.php | 32 ------------------- 2 files changed, 9 insertions(+), 32 deletions(-) delete mode 100644 src/AppBundle/Controller/DefaultController.php diff --git a/app/config/routing.yml b/app/config/routing.yml index 9b55ca4a4..dd192f395 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -1,3 +1,12 @@ app: resource: @AppBundle/Controller/ type: annotation + +# The FrameworkBundle:Template:template controller can be used when you only +# need to render a template without any variables. +# See http://symfony.com/doc/current/cookbook/templating/render_without_controller.html +homepage: + path: / + defaults: + _controller: FrameworkBundle:Template:template + template: 'default/homepage.html.twig' diff --git a/src/AppBundle/Controller/DefaultController.php b/src/AppBundle/Controller/DefaultController.php deleted file mode 100644 index 816d52d88..000000000 --- a/src/AppBundle/Controller/DefaultController.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace AppBundle\Controller; - -use Symfony\Bundle\FrameworkBundle\Controller\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; - -/** - * Controller used to render the application homepage. - * - * @author Ryan Weaver - * @author Javier Eguiluz - */ -class DefaultController extends Controller -{ - /** - * @Route("/", name="homepage") - */ - public function indexAction() - { - return $this->render('default/homepage.html.twig'); - } -}