Examples of common statements in the twig template and summary of the twig template. Examples of common statements in the twig template, and summary of the twig template this article describes common statements in the twig template. For your reference, please refer to the following details: Examples of common statements in the twig template and summary of the twig template for the recently written static pages.
This example describes common statements of the twig template. We will share this with you for your reference. The details are as follows:
A symfony template is required for the recently written static page, so we will make a summary of the twig template statement: hope it can help beginners.
The code structure is as follows:
{% Extends ':: l_sh_base.html.twig '%} // introduced base template {% block title %} // webpage title merchant center-service category {% endblock %} {% block stylesheets %} // introduced css or js file {parent ()}}
{% Endblock %} {% block header %} // webpage header content {parent () }}{ % endblock %} {% block body %} // webpage subject content
{% For item in appliance %} // for loop 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 %} // content at the bottom of the page {parent () }} {% endblock %}
Note that HTML comments cannot be written outside %.
Permanent Address: http://blog.it985.com/12383.html
This article is from the IT985 blog. please indicate the source and relevant links when reprinting.