mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-01 21:17:21 +00:00
Fix typo in enum twig doc functions
This commit is contained in:
committed by
Fabien Potencier
parent
d184e9fe12
commit
3889bc7b18
@@ -13,10 +13,12 @@
|
||||
{{ enum('App\\MyEnum').SomeCase.value }}
|
||||
|
||||
{# get all cases of an enum #}
|
||||
{% enum('App\\MyEnum').cases %}
|
||||
{% for case in enum('App\\MyEnum').cases %}
|
||||
{{ case.value }}
|
||||
{% endfor %}
|
||||
|
||||
{# call any methods of the enum class #}
|
||||
{% enum('App\\MyEnum').someMethod() %}
|
||||
{{ enum('App\\MyEnum').someMethod() }}
|
||||
|
||||
When using a string literal for the ``enum`` argument, it will be validated during compile time to be a valid enum name.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user