Twig
Twig copied to clipboard
Twig, the flexible, fast, and secure template language for PHP
Feature: https://twig.symfony.com/doc/3.x/tags/cache.html Often when working with cache in templates you'd like to define variables that are persisted to scope outside cache block, both when generated and later when retrieved from...
The variable `formatted_payroll_cost` works below ``` EDIT PAYROLL Total: ₦{{ formatted_payroll_cost }} {% for office,staff_list in staffs %} {{ office }} {% for _user in staff_list %} {{ _user.name }}...
Feature: https://twig.symfony.com/doc/3.x/tags/cache.html Often cache tags are determined when generation the cache, so support for setting tags inside the block would be beneficial. Example would be loading data either by means...
## The Problem I would like to create a Twig implementation of my templating interop standard, [`TemplateInterface`]. One of the types that it allows for context is `ArrayAccess`, or even...
Hi, I need to be able to mark an object as safe based on a prop value. Following the docs, I can successfully add a safe class/interface. However, the use...
The `Twig\ExpressionParser` class is marked as internal (`@internal` in the DocBlock for the class), which came to my attention because Psalm reported uses of `ExpressionParser::OPERATOR_LEFT` and `ExpressionParser::OPERATOR_RIGHT` in one of...
This example from documentation works: ``` {% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %} {% set fruits = items|column('fruit') %} ``` But when I replace...
Hey, today I noticed, that the Twig documentation for version 1.x listed filters which implemend in 2.x and higher. The documention files for 1.x seems to be okay. However is...
I'm trying to create Twig timeline into Clockwork, but right now there is no way to access the start and end timestamps in the profiler. In the timeline it is...
# Recursive loops ## Why While it's currently possible to loop through recursive tree-like structures in Twig, it requires creating a macro, which is slightly inconvenient and hard to get...