Open hansgrinwis opened 1 year ago
@hansgrinwis in the meantime, i believe you can write this using the default()
filter inside your macro:
{% macro menuLink(href, config, active, class) %}
<a href="{{ href }}" class="{{ active|default(false) ? 'active' }} {{ class|default('') }}">{{ config.label }}</a>
{% endmacro %}
Obviously i’m assuming here that you have an object for config
with a label
key, but the rest of the code should match with your case and work.
@furioursus That's a nice workaround. Thank you!
Hello junstyle,
Thank you for this extension. When writing this piece of code:
the extension reports the following "problem":
but Twig supports default values for arguments nowadays.
Can this be fixed?