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

Can't set variable in extending template #273

Closed
DominikStiller opened this issue Feb 13, 2015 · 4 comments
Closed

Can't set variable in extending template #273

DominikStiller opened this issue Feb 13, 2015 · 4 comments

Comments

@DominikStiller
Copy link

I can't put other tags (I tried set and if/endif) in a template which uses "extends". I tried the following code:

{# layout.twig #}
{{ variable }}
{% block content %}

{% endblock %}
{# home.twig #}
{% extends "layout.twig" %}
{% set variable = "Test" %}

{% block content %}
   Content
{% endblock %}

It works in the PHP Twig, but not in JTwig.
I either get Wrong extends syntax Explanation: Input position (line 1, pos 12): {% extends "layout.twig" %} ^ or Unknown tag Explanation: Input position (line 2, pos 4): {% extends "layout.twig" %} ^, depending on where I put the set statement.

@thomas-p-wilson
Copy link

Thanks for the feedback @domistiller. What version of Jtwig are you using?

@DominikStiller
Copy link
Author

I am using Version 3.1.1

@thomas-p-wilson
Copy link

That fits. This matter was resolved in PR #154 which is in master and slated to be released for 4.0.0

@DominikStiller
Copy link
Author

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants