Twig
The flexible, fast, and securetemplate engine for PHP
keys
Found a typo or an error? Want to improve this document? Edit it.
Need support or have a technical question? Ask support on Stack Overflow.
The keys filter returns the keys of an array. It is useful when you want to iterate over the keys of an array:
1 2 3
{% for key in array|keys %} ... {% endfor %}