Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Support string literals #4123

Closed
wants to merge 1 commit into from
Closed

Commits on Jul 6, 2024

  1. Support string literals

    This allows to write a string literal using backticks. When using a literal, you don't need to
    escape backslashes. This is ideal for situation where you want to reference a fully qualified
    class name. For example in a `constant` function.
    
    For example, before you had to write:
    ```twig
    {{ constant("App\\Entity\\Class::Constant") }}
    ```
    
    Now you can write:
    ```twig
    {{ constant(`App\Entity\Class::Constant`) }}
    ```
    
    Besides easier to read, there is another huge benefit: when doing a text search for a fully
    qualified class name, it will show up.
    ruudk committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    b5bf3bf View commit details
    Browse the repository at this point in the history