Twig Template Common Statement instance summary _php instance

Source: Internet
Author: User
Tags php template smarty template
The examples in this article describe common statements for twig templates. Share to everyone for your reference, as follows:

Recently written static pages need to set Symfony template, so will use the Twig template statement to do a summary: hope to help beginners.

The code structure is as follows:

{% extends ':: L_sh_base.html.twig '%}//introduced base template {% block title%}//Page title Merchant Center-Repair category {% Endblock%}{% block stylesheets%}// Introduced CSS or JS file {{parent ()}}
 
   {% endblock%}{% block header%}//Page header contents {{parent ()}}{% endblock%}{% block body%}/ /page Body contents
 
   {% for item in appliance%}//for Loop statement {{Item.appliance_name}}{% endfor%}src= ' {{Asset (' Image/appliance /')}}{{Item.image}} "//Picture Path {{path (' Zm_shop_appliance_add ')}}//href jump path {% if Item.status = 1}  //if statement class=" Mar Quee "{% endif%}{% endblock%}{% block footer%}//page bottom content {{parent ()}}{% Endblock%}

Note that you cannot write HTML annotations outside of%

Permanent address of this article:http://blog.it985.com/12383.html
This article is from IT985 blog, please indicate the source and corresponding link when reproduced.

More about PHP template related content readers can view the site topics: "PHP Template Technology Summary", "Smarty Template Primer Basic Tutorial", "CodeIgniter Introductory Tutorial" and "thinkphp Introductory tutorial"

I hope this article is helpful to you in PHP programming.

  • Related Article

    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.