Examples of common twig templates and twig templates _ PHP Tutorial

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.