Twig Template Engine Playground

Powered by Twig 3.21.1

Explore Twig template engine features in a sandboxed environment. This lab allows arbitrary templates with security restrictions to prevent system access.

Twig Template Playground

Available Variables:

user: "guest"
time: Current time
date: Current date
random: Random number
pi: 3.14159
items: Array of fruits
users: Array of user objects
server: $_SERVER array
session: $_SESSION array

⚡ Twig Sandbox is enabled - Some operations are restricted for security

Basic Examples

{{ user }} {{ 10 + 20 * 3 }} {{ "hello" | upper }} {{ date("Y-m-d") }}

Advanced Examples

{% set name = "World" %}Hello {{ name }}! {{ users | json_encode }} {{ items | join(", ") }} {{ range(1, 10) | join(" ") }}