0

Hi i was using bolt and twig and i got this error

A template that extends another one cannot start with a byte order mark (BOM); it must be removed in "index.twig" at line 1.

but I cant seem to find out what the problem here is. searched arround on the internet found some answers here on stack like this one. but this didnt seem to help for me.

my _master.twig file looks like this.

<!DOCTYPE html>
<html lang="en">
<head>
   {% block SEO %}
   {% endblock %}
   {% include "partials/_head.twig" %}
</head>
<body>
   {% include "partials/_header.twig" %}
   {% block content %}
   {% enblock %}
   {% include "partials/_footer.twig" %}
   {% include "partials/_scripts.twig" %}
</body>
</html>

And my index.twig like this

{% extends "partials/_master.twig" %}

{% block SEO %}
  <title>Home</title>
  <meta name="description" content="Beschrijving"/>
  <meta name="keywords" content="woordjes, enzo"/>
{% endblock %}

{% block content %}
  <div class="page"...>
{% endblock %}

ive had some other bolt/twig projects but this is how i did it everytime now suddenly it gives me back this error. i hope someone can help me solve this error.

Community
  • 1
  • 1
B. Dionys
  • 842
  • 6
  • 30

2 Answers2

5

It's an encoding problem.

According to this, you must encode your document with UTF-8 without BOM.

Best regards,

Community
  • 1
  • 1
  • yes that was exactly what was the problem. sorry for my late reaction. one of my colleague's pointed it out to me. but its stil the good answer so thank you :) – B. Dionys Mar 14 '17 at 15:22
0

So this happened to me again. For people reading this post in the future,

If you open files that are a bit old or outdated then PHP storm may change the encoding type for some reason.

So if you open older files. keep in mind that PHP storm may change the encoding.

Hope this helps, happy coding!

B. Dionys
  • 842
  • 6
  • 30