diff --git a/doc/functions/enum.rst b/doc/functions/enum.rst index 6fb9bb009..23d5f0c3c 100644 --- a/doc/functions/enum.rst +++ b/doc/functions/enum.rst @@ -32,6 +32,15 @@ When using a string literal for the ``enum`` argument, it will be validated during compile time to be a valid enum name. +As the FQCN can be long, you can store the enum in a variable to avoid repeating +it: + +.. code-block:: twig + + {% set suite = enum('App\\CardSuite') %} + {{ suite.Clubs.value }} {# "clubs" #} + {{ suite.Spades.value }} {# "spades" #} + Arguments ---------