twig.js
twig.js copied to clipboard
block function ignores second parameter
Asume you have a file foo.twig
<div class="sg-cw-col-xs-12">
{% block product_info_1 %}
<label>Some stuff</label>
{% endblock %}
</div>
In file bar.twig you want just to output the block product_info_1
<div class="sg-cw-col-xs-6">
{{ block('product_info_1', 'foo.twig') }}
</div>
Nothing will be outputed. Trying {{ block('product_info_1', 'foo.twig') is defined }}
also returns false
.
It seems the second argument is ignored.
Nice catch, twig.js doesn't support passing a custom template to the block()
function.
For reference, it was introduced to Twig in https://github.com/twigphp/Twig/pull/2245
- Reference in TwigPHP docs
- TwigPHP example
- twig.js example