Inheritance fail to include meta charset [duplicate]

i try to have the meta charset set to UTF-8.
It do work for the base.html.twig file :

<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}
...
<link rel="stylesheet" href="/css/app.css">
{% endblock %}
</head>
<body>

As you can see my navbar wich is located into this file is correctly reading special char with accent :
enter image description here

But it’s not working when i’m on a file that extend the base.html.twig :
enter image description here

Here it is the code of the file that extend base.html.twig

{% extends "base.html.twig" %}

{% block body %}
<div class="row">
    <div class="col-lg-4"></div>
    <div class="col-lg-5">
        <form>
            <div>
                <a class="btn btn-block" href="{{ path('productList') }}">
                    <div class="form-control">
                        <i class="fa fa-book-open"></i> Accéder à tous nos produits
                    </div>
                </a>
            </div>
            <div>
                <a class="btn btn-block" href="{{ path('stockHomePage') }}">
                    <div class="form-control">
                        <i class="fa fa-boxes"></i> Gestion du stock
                    </div>
                </a>
            </div>
        </form>
    </div>
</div>
{% endblock %}

As you can see the character é and à are displayed with a <?>

If i add the meta charset into the second file :

<meta charset="UTF-8">

It work, but i don’t want to add this to all my file !
I’m suppose to extends base.html.twig so…
Could you please explain me why it seams to fail ?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *