Here is my code block, I want to pass the service variable to component.
{% for service in services %}
<div data-service="#development"
class="col-md-4 col-sm-6 wow fadeInUp"
data-wow-duration="300ms"
data-wow-delay="0ms"
>
<div class="media service-box">
<div class="pull-left">
<i class="fa fa-line-chart"></i>
</div>
<div class="media-body">
{% component 'editable' file={{ service }} %}
</div>
</div>
</div><!--/.col-md-4-->
{% endfor %}
Thanks,
Inside {% .. %} directives you can simply use twig variable names without the double curly braces {{ .. }} around them. The {{ .. }} braces just designate twig expressions wheras {% .. %} designates twig statements. See twig templating documentation. Inside both twig variables can be simply accessed by their names.
So here you could just do like
{% component 'editable' file=service %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With