I've read the documentation on template inheritance. That is not what I am
trying to do.
In php templates, I can do something like this:
<?php if ($view['slots']->has('sidebar')): ?>
<div id="sidebar">
<?php echo $view['slots']->output('sidebar'); ?>
</div>
<?php endif; ?>
However I don't see a way to accomplish that in twig because I haven't found
a way to check in the layout if a block has been defined in the child
template.
I would need something like
{% ifblock sidebar %}
<div id="sidebar">
{% block sidebar %}
{% endblock sidebar %}
</div>
{% endifblock %}
where {% ifblock sidebar %} would check if the block "sidebar " has been
defined in the child template, If true, then it will render the markup
wrapping the block and the block.
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en