Fix typo in enum twig doc functions

This commit is contained in:
Baptiste
2024-12-30 15:58:07 +01:00
committed by Fabien Potencier
parent d184e9fe12
commit 3889bc7b18
+4 -2
View File
@@ -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.