Misc.
with
Caches a complex variable under a simpler name. This is useful when accessing an "expensive" object.
For example:
{% with total=game.players|length %}
SELECT id FROM games
WHERE number_players >= {{ total }};
{% endwith %}
The populated variable (in the example above, total
) is only available between
the {% with %}
and {% endwith %}
tags.
Is something missing?
If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the repository. Once we merge it, the changes will be reflected on the website the next time it is deployed.
Thank you for your contributions!