Skip to content

Allow multiple statements (semicolon) #4657

@rgpublic

Description

@rgpublic

I wonder why no one ever asked for this before. I think Twig is by now a very mature and grownup template language. Even if we try to keep our templates clean, the need for multiple statements within a {% %} block arises very quickly. If you need e.g. 5 such statements you need 5 such {% %} blocks. It's not very readable and gets tedious fast. Therefore, I'd like to request the feature ";". It could be implemented extremely easy: It's actually just syntactic sugar for "%}{%". A ";" at the end of a block should be allowed though and just ignored. Since the ";" isn't used for anything else at the moment this wouldn't even cause a compatibility issue.

Thanks for considering & of course for making Twig :-)

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