Skip to content

Twig_String_Loader hick-up with variable names using underscores #1519

@zebba

Description

@zebba

I've set-up a small test-case that demonstrates a hick-up the Twig_String_Loader currently has: it doesn't process properties that user underscores in their name, using {{ foo.acme_string }} to access $acme_string will fail with

Twig_Error_Runtime: Method "acme_string"
for object "Tests\Foo" does not exist
in "{{ foo.int }}, {{ foo.acme_string }}"

Although as per doc-comment on the Loader\String the loader should only be used for testing purposes this should work anyway. Else it is not really suitable for testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions