Skip to content

Weird behavoiur with hasanyrole and else #626

@Swiek

Description

@Swiek

Hello,

I have updated to the latest version.
We have the following check in an view:

@hasanyrole(['mod', 'admin'])
    Hello admin
@else
    Hello other people
@endhasanyrole

This results in:

Parse error: syntax error, unexpected 'else' (T_ELSE), expecting end of file

When I look at the cached file I see this result:

@hasanyrole(['mod', 'admin'])
    Hello admin
<?php else: ?>
    Hello other people
@endhasanyrole

When I change it in:

@hasanyrole(['mod', 'admin'])
    Hello admin
@endhasanyrole

It works fine.

Any other people that have experience with this?

Erwin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions