Twig icon indicating copy to clipboard operation
Twig copied to clipboard

Twig, the flexible, fast, and secure template language for PHP

Results 200 Twig issues
Sort by recently updated
recently updated
newest added

Create an "if" statement with nothing set inside throws error if this is done outside the {% block content %} tag. ``` {% extends "_layouts/_layout.twig" %} {% if craft.app.request.segment(2) !=...

There are a few twig filters that allow arrow functions as argument: `map`, `filter`, `reduce`. All of these apply the arrow function to array values (or keys). I wonder, could...

I've noticed a few issues with the documentation, especially in regards to additional functionality provided by Symfony: 1) the tag "**transchoice**" mentioned at https://twig.symfony.com/doc/3.x/ is not part of the Symfony...

I'm trying to call a static method from a Twig template and It cannot be done easily. The main logic behind this is that 'pure' PHP classes are easier to...

In our project (Craft CMS) we have some common html patterns, which would ideally be wrapped around user content based on a "style" selection. E.g. an image gallery which either...

`.github` directory and `.editorconfig`, `.gitattributes`, `.gitignore` and `.php-cs-fixer.dist.php` are present in dist package. I added `export-ignore` attribute to them.

I'm using the twig extra bundle's ``markdown_to_html`` filter on Symfony 6.1 with League/CommonMark as the markdown parser library. The library has a few configuration options that can be passed to...

Markdown

``` {% set x = null %} {{ dump(x|default()) }} => outputs an empty string {{ dump(x|default(null)) }} => outputs null {{ dimp(y|default()) }} => outputs null ``` `|default` and...

This is #3719 ported to 2.x and improved a bit. I also reported https://github.com/php/php-src/issues/8932 because the underlying behavior of PHP is broken to me. If a static method cannot be...

Hi, Since PHP 8.1 we can use Enums. Which in my opinion are a great asset to PHP. But unfortunate there is not an elegant way of retrieving values inside...