Example Analysis of Common sentences in twig template
This article mainly introduces the example analysis of commonly used sentences in twig template, which is very detailed and has certain reference value. Friends who are interested must finish it!
The details are as follows:
The recently written static page requires a set of symfony templates, so make a summary of the twig template statements used: hope to help beginners.
The code structure is as follows:
{% extends':: introduced base template {% block title%} / / Page title Merchant Center-maintenance Classification {% endblock%} {% block stylesheets%} / introduced css or js file {{parent ()} {% endblock%} {% block header%} / / Web quality content {{parent ()} {% endblock%} {% block body%} / / Web page body content {% for item in appliance%} / / for circular statement {{item.appliance_name}} {% endfor%} src= "{{asset ('image/appliance/')}} {{item.image}}" / / Image path {{path (' zm_shop_appliance_add')}} / / href jump path {% if item.status = = 1%} / / if statement class= "marquee" {% endif%} { % endblock%} {% block footer%} / / the bottom of the page {{parent ()}} {% endblock%}
It should be noted that HTML comments cannot be written outside%.
The above is all the contents of the article "sample Analysis of commonly used sentences in twig templates". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!