Where is documented the existence of this keyword? (I guess it is a constant, rather than an object, right?).
Anyway, I'd like to know where it is documented, to see if there are other keywords that I don't know about.
Thanks
This doesn't really answer the question, but I think it's important to mention it.
The _self
itself is not really deprecated nor removed, but its usage is!
If you look for deprecated features in Twig 2.*, you'll find there are none. So, you may think falsely that you're safe, or scratch your head (like I did) in finding why did it stop working in v2.0.
But actually, in Twig v1, _self
was an object, with which you could do _self.templateName
, or call Twig macros with it. Its usage as object was deprecated but it worked.
In Twig v2, _self
is no more an object but a string, which actually holds the templates name (the previous value of _self.templateName
).
So, if you used it in Twig v1 as an object - your code will fail in Twig v2.
Anyway, it seems like a bit messy resolution of the _self
issue.
_self
is deprecated everywhere but used with the{% import %}
tag.