Reputation: 627
It's a pretty simple question, but I didn't find the answer yet.
This code:
{{ civilite }}{{ nom }}{{ prenom }}
Prints MRJOHSONBarry
I want to add space between the variables, how could I do it?
Upvotes: 2
Views: 16500
Reputation: 11
I just ran into the problem of needing
on Twig v2.7.4 and cured it by moving to v3.1.1
Upvotes: 1
Reputation: 74
I think the concatenation is the right choice here, when it's only for variable :
{{ var ~ " " ~ var2 }}
But when it's for variable and string, I guess that the 1rst choice would be enough :
{{ var }} My string
instead of
{{ var ~ " My string" }}
(Not if you want apply filter on the string)
Upvotes: 2
Reputation: 81
I don't know if it's good but I simply use this. Tell me if I'm right :
{{ firstname }}{{ " " }}{{ lastname }}
Upvotes: 8
Reputation: 728
If {{ civilite }} {{ nom }} {{ prenom }} doesn't work...
how about
{{ civilite }} {{ nom }} {{ prenom }}?
Upvotes: 14