I have twig template named homepage.html.twig in app/Resources/homepage. I'm trying to render this template with the HomeController in this way:
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class HomeController extends Controller
{
/**
* @Route("/home", name="homepage")
* @return \Symfony\Component\HttpFoundation\Response
*/
public function homeAction()
{
return $this->render('homepage/homepage.html.twig');
}
}
Here is the twig template:
{% extends 'base.html.twig' %}
{% block body %}
<div class="container">
<div class="jumbotron">
<h1>Navbar example</h1>
<p>This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.</p>
<p>
<a class="btn btn-lg btn-primary" href=# role="button">View navbar docs »</a>
</p>
</div>
</div>
{% endblock %}
Why the rendering of this template is not working ?