In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the method of using loop tag in phpcms, which is very detailed and has certain reference value. Friends who are interested must finish it!
In phpcms, loop is widely used, generally in two forms.
The form is as follows:
Form one:
{loop $data $a} {$a} {/ loop}
Form two:
{loop $data $a $b} {$a}-{$b} {/ loop}
The differences are as follows:
First of all, $data is an array, the form of $data array is in this case, "aa", "bb", "cc", in this form, we want to get the first value aa, to use this code $data [0], to get the second value is $data [1], and so on.
Form 2 in the $data array has a key value, which is this form of "A1 = > aa", "a2 = > bb", "A3 = > cc". A1 Magi a2 data A3 is called the key value of $data. If we want to take out the variable value of A1, that is, aa, we can use $data [A1], we can get aa, in the same way $data [a2], that is, bb.
So in PHPCMS, form one:
In the loop, $an is $data [0], $data [1], and $data [2], respectively. We can directly write {$a} to get the value of $a.
Form two:
In the loop $an is A1, a2, a3 aa,bb,cc in the above example.
Examples are as follows:
Example 1:
There are three values "aa", "bb" and "cc" in the $data array, so:
{loop $data $a} {$a} {/ loop}
Aa,bb,cc will be output.
Example 2:
There are three "A1 = > aa", "a2 = > bb" and "A3 = > cc" with key values in the $data array, so
{loop $data $a $b} {$a}-{$b} | {/ loop}
Output a1-aa | a2-bb | a3-cc |.
The above is all the contents of the method of using the loop tag in phpcms. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.