pebble
pebble copied to clipboard
Error passing named arguments to macros when using named imports
Given the following macro saved in the file forms.html:
{% macro input(type="text") %}
<input type="{{ type }}" />
{% endmacro %}
If you import forms.html without assigning the import to a variable then using named arguments works fine, e.g:
{% import "forms" %}
{{ input(type="text") }}
But if you import forms.html and set it as a variable then passing named arguments throws a ParserException with the message "Can not use named arguments when calling a bean method", e.g.
{% import "forms" as forms %}
{{ forms.input(type="text") }}
current implementation does not support named arguments , you can work around like this: ··· {% import "forms" as forms %} {{ forms.input("text") }} ···