Uchome label description

Source: Internet
Author: User
Let's start with the commonly used labels and variable output in the template.

I. variables:

For example, we defined a variable in the PHP file and assigned a value, for example:

$ Siteurl = 'HTTP: // www.demi.cn ';
$ Sitename = 'successful website construction by Zhu Jun ';

So how can I output it in the template? In fact, this is very simple:
Site address: $ siteurl
Site name: $ sitename
The output result is as follows:
Site address:Http://www.demi.cn
Site name: Zhu Jun succeeded in website construction

Ii. Labels
The uchome template generally contains the following tags:
If tag, else tag, loop tag, EVAl label
1. The if tag and else Tag mainly determine the tag. The format is as follows:
<! -{If condition}->
Output content
<! -{/If}->
And

<! -{If condition}->
Output content 1
<! -{Else}->
Output content 2
<! -{/If}->

The preceding conditions can be variables, valid PHP functions, and user-defined functions.

2. Loop tag
Loop labels are loop output arrays. If you do not understand arrays, please refer to relevant materials.
Format 1:
<! -{Loop $ S $ key $ value}->
$ Value
<! -{/Loop}->
Equivalent to PhPCodeMedium

Foreach ($ s as $ key => $ value ){
Echo $ Value
}

Format 2:
<! -{Loop $ S $ value}->
$ Value
<! -{/Loop}->
Equivalent to PHP code

Foreach ($ s as $ value ){
Echo $ Value
}

$ S must be a two-dimensional array.

3. EvAl label

EVThe Al tag is mainly used to execute PHP syntax in the template.After Al, you must keep up with valid PHP syntax, such:
<! -{EVAl echo 'this is the PHP syntax ';}->

Basically, there are several tags in the uchome template, which are also the most common ones.

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.