Fabien Potencier 760341fa8c feature #3533 add support for the class constant on objects (dunglas)
This PR was merged into the 3.x branch.

Discussion
----------

add support for the class constant on objects

This is especially useful for Symfony Turbo:

Before:

```twig
<div id="books" {{ turbo_stream_listen('App\\Entity\\Book') }}></div>
```

After:

```twig
<div id="books" {{ turbo_stream_listen(constant('class', book) }}></div>
```

Replace https://github.com/php/php-src/pull/6763

Commits
-------

0d6bd458 add support for the class constant on objects
2022-03-25 09:58:54 +01:00
2022-01-29 16:34:05 +01:00

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://blackfire.io/docs/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
Languages
PHP 99.9%