There are two TWIG functions which can help you to get array of ENUM values in your templates.
They are enum_values()
and enum_readable_values()
.
{% for value in enum_values('BasketballPositionType') %}
{{ value }}<br />
{% endfor %}
PG
SG
SF
PF
C
{% for key, value in enum_readable_values('BasketballPositionType') %}
{{ key }} => {{ value }}<br />
{% endfor %}
PG => Point Guard
SG => Shooting Guard
SF => Small Forward
PF => Power Forward
C => Center