diff --git a/app/Resources/views/default/index.html.twig b/app/Resources/views/default/index.html.twig index ed261498cb..75842ebe18 100644 --- a/app/Resources/views/default/index.html.twig +++ b/app/Resources/views/default/index.html.twig @@ -1,5 +1,76 @@ {% extends 'base.html.twig' %} {% block body %} - Homepage. +
+
+
+

Welcome to Symfony {{ constant('Symfony\\Component\\HttpKernel\\Kernel::VERSION') }}

+
+ +
+

+ + + Your application is ready to start working on it at: + {{ base_dir }}/ +

+
+ + + +
+
+{% endblock %} + +{% block stylesheets %} + {% endblock %} diff --git a/src/AppBundle/Controller/DefaultController.php b/src/AppBundle/Controller/DefaultController.php index 8569811ee0..3bd767561a 100644 --- a/src/AppBundle/Controller/DefaultController.php +++ b/src/AppBundle/Controller/DefaultController.php @@ -9,10 +9,13 @@ class DefaultController extends Controller { /** - * @Route("/app/example", name="homepage") + * @Route("/", name="homepage") */ - public function indexAction() + public function indexAction(Request $request) { - return $this->render('default/index.html.twig'); + // replace this example code with whatever you need + return $this->render('default/index.html.twig', array( + 'base_dir' => realpath($this->container->getParameter('kernel.root_dir').'/..'), + )); } } diff --git a/src/AppBundle/Tests/Controller/DefaultControllerTest.php b/src/AppBundle/Tests/Controller/DefaultControllerTest.php index 66ca01878a..87989da90d 100644 --- a/src/AppBundle/Tests/Controller/DefaultControllerTest.php +++ b/src/AppBundle/Tests/Controller/DefaultControllerTest.php @@ -12,6 +12,7 @@ public function testIndex() $crawler = $client->request('GET', '/'); - $this->assertTrue($crawler->filter('html:contains("Homepage")')->count() > 0); + $this->assertEquals(200, $client->getResponse()->getStatusCode()); + $this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text()); } }