Twig
Twig copied to clipboard
Twig, the flexible, fast, and secure template language for PHP
Hi! This might be a bug: The precedence of ?? is not the same in twig as it is in php. > php: $x = 'a'; var_dump(null ?? $x.'_1'); //...
Something like : ```twig {{ '%s %s %s'|format(...params) }} ```
If I use var-dumper's `dump()` in PHP code, I get very nicely formatted output of the variable in the HTML page. However, using `{{ dump(foo.bar) }}` in a Twig template...
Since there is a check for two types of property, we should also return the one we found. Without this, cases where a property is accessed that exists in the...
To get the current template filename, I use _self directly. I was wondering how I can get the filename for the extended template's filename. Is there a variable like _parent...
Consider the following Twig templates: > index.html.twig ```twig {{ obj.foo() }} {% include "partial.twig" with { obj2: { foo: obj.foo } } %} ``` > partial.twig ```twig {{ obj2.foo() }}...
On https://twig.symfony.com/doc/2.x/ and https://twig.symfony.com/doc/3.x/, the links to the Symfony documentation have invalid anchors (`_` needs to replaces with `-`). Also some anchors does not exist at all, the page it...
Some suggestions/questions for https://twig.symfony.com/doc/2.x/filters/html_to_markdown.html. If you help me with answers, I'll come up with a PR: 1: `twig/markdown-extra` doesn't do any conversion itself; it just looks for a conversion library...
Exception Only "include" tags are allowed within a "sandbox" section when using the include function
When trying to render the following template, we get an exception: `{% sandbox %}{{ include('foo.twig') }}{% endsandbox %}` > Twig\Error\SyntaxError: Only "include" tags are allowed within a "sandbox" section in...
Empty Coalesce adds the `???` operator to Twig that will return the first thing that is defined, not null, and not empty. This is particularly useful when you're dealing with...