Twig icon indicating copy to clipboard operation
Twig copied to clipboard

"A block must start with a tag name"

Open haiyamicode opened this issue 14 years ago • 5 comments

I get this error all the time while my syntax is totally correct, example:

{% extends "views/layouts/main.twig" %}

But if i change it to this:

{extends "views/layouts/main.twig" }

Crazy! It doesn't complain anymore about the line. More: the incorrect syntax {extends "views/layouts/main.twig" } is treated as a correct tag line (Crazy!) because I got over the error with that line but got into the same error in the file "views/layouts/main.twig". That means the main.twig file is actually included. What happened??

note: i'm using twig with Yii framework via an extension.

haiyamicode avatar May 17 '12 01:05 haiyamicode

{% extends "views/layouts/main.twig" } is not totally correct, its missing a % in the close tag which should be %}. I'm guessing not syntax error occurs with {extends "views/layouts/main.twig" } as it is treated as plain text by Twig.

markstory avatar May 17 '12 01:05 markstory

@markstory

{% extends "views/layouts/main.twig" } is not totally correct, its missing a % in the close tag which should be %}. I'm guessing not syntax error occurs with {extends "views/layouts/main.twig" } as it is treated as plain text by Twig.

Sorry for missing it, but still, the totally correct line doesn't work, still that error "A block must start with a tag name" on that specific line. And no, the {extends "views/layouts/main.twig" } is treated as a tag line by it (Crazy!) because I got over the error with that line but got into the same error in the file "views/layouts/main.twig". That means the file is actually included.

haiyamicode avatar May 17 '12 02:05 haiyamicode

Have you modified the default delimiters?

markstory avatar May 17 '12 02:05 markstory

@markstory of course not

haiyamicode avatar May 17 '12 03:05 haiyamicode

Solved, didn't know it was changed, sorry dudes.

haiyamicode avatar May 17 '12 06:05 haiyamicode