When I was doing plain PHP, I was simply doing this:
printf(_("Hello %s !"), $name);
Now with Twig, I must use the trans tag. So I've copy/paste the documentation example, and here's my full template:
{% extends 'MyAppBundle::layout.html.twig' %}
{% block content %}
<h1>
{% trans %}
Hello {{ name }}!
{% endtrans %}
</h1>
{% endblock %}
Why Symfony return the following exeption ?
A message must be a simple text in "MyAppBundle::home.html.twig"
500 Internal Server Error - Twig_Error_Syntax
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…