mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-18 05:16:30 +00:00
2a52ec2596562e119651cb272a4550243303bdfc
enum and enum_cases (Kocal)
This PR was merged into the 3.x branch.
Discussion
----------
Improve documentation examples for `enum` and `enum_cases`
It may be obvious, but I first thought initializing an BackendEnum with a specific value could be possible with `enum(FQCN, value)`, but it does not, it always returns the first case instance (if exists).
Instead, `enum(FQCN).from(value)` must be used, and I think it's worth to improve `enum()` examples.
Commits
-------
def4abbd5e Improve documentation examples for `enum` and `enum_cases`
Twig, the flexible, fast, and secure template language for PHP
==============================================================
Twig is a template language for PHP.
Twig uses a syntax similar to the Django and Jinja template languages which
inspired the Twig runtime environment.
Sponsors
--------
.. raw:: html
<a href="https://docs.blackfire.io/introduction?utm_source=twig&utm_medium=github_readme&utm_campaign=logo">
<img src="https://static.blackfire.io/assets/intemporals/logo/png/blackfire-io_secondary_horizontal_transparent.png?1" width="255px" alt="Blackfire.io">
</a>
More Information
----------------
Read the `documentation`_ for more information.
.. _documentation: https://twig.symfony.com/documentation
Description
Languages
PHP
99.9%