I have index.html.twig and base.html.twig in the same directory folder. I have the following scripts
index.html.twig
{% extends('base.html.twig') %} {% block body %} helo body {{ parent() }} {% endblock %} {% block footer %} This footer {% endblock %}
base.html.twig
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>{% block title %}Welcome!{% endblock %}</title> {% block stylesheets %}{% endblock %} <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" /> </head> <body> {% block body %}The body block{% endblock %} {% block sidebar %}The body sidebar{% endblock %} </body> </html>
It returns me with the error โCould not find the templateโ base.html.twig โinโ FacebookBundle: Default: index.html.twig. โI also noticed that some people used :: just before the template name. Why and how to fix it?
source share