Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of Common sentences in twig template

Shulou Source: shulou.com Published: 2022-06-03 13:03:46 10月04日 Update

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!

Tags: Templates sentences content web pages commonly used examples analysis articles paths subjects code values interests beginners merchants pictures headers guys buddies bottom Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Information Docker Apple vpn