Want to create common header and footer templates that are included on several html pages in Symfony2. it gives me error:
Unable to find template "Bundle:Controller:header.html.twig" in base.html.twig at line 16.
Directory
src
/HelloBundle
/Controller
MainController.php
/Resources
/views
/Main
header.html.twig
index.html.twig
Code in my index.html.twig file:
<div class="container">
<div id="header">
{% include "HelloBundle:Main:header.html.twig" %}
</div>
</div>
in my base.html.twig file:
<html>
<head>
<meta charset="UTF-8" />
<title></title>
{% block stylesheets %}
</head>
<body>
16: {% include 'Bundle:Controller:header.html.twig' %}
{% block body %}
{% endblock %}
{% block javascripts %}
{% endblock %}
</body>
</html>
and my header.html.twig
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<ul class="nav navbar-nav">
<li class="active"><a href="{{ path('index') }}">Home</a></li>
<li><a href="{{ path('english') }}"> LEARNING</a></li>
</ul>
</div> <!-- collapse navbar-collapse -->
</div> <!-- container-fluid-->
</nav> <!--navbar navbar-default -->