In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail what are the common code snippets about smarty. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
The details are as follows:
1 、
{html_options values=$cust_ids selected=$customer_id output=$cust_names}
Description: generate a drop-down menu. Values= an array where the array element is a list value selected= a value, which is the default column
Table value output= an array with array elements as displayed list values
{html_checkboxes values=$cust_ids checked=$customer_id output=$cust_names separator= ""}
Description: check box. Ditto; separator= "" refers to a string that separates each check button
{html_radios values=$cust_ids checked=$customer_idoutput=$cust_names separator= ""}
Description: radio button
2 、
{counter start=0 skip=2 print=ture}
Description: counter, when used later, starts with 0 and increases by 2 each time.
3 、
{section loop=$data} {$data [rows]} {/ section}
Description: reincarnation returns the value of an array element (or a sequence)
4 、
{assign var= "name" value= "Bob"} The value of $name is {$name}. / / The value of $name is Bob.
Description: assignment
5 、
{fetch file= "http://www.myweather.com/68502/" assign=" weather "}
Description: fetch is used to get files from the local file system, HTTP or FTP and display the contents of the files. If the file name
Start with "http://"" and the page of the site will be taken and displayed. If the file name starts with "ftp://", it will be obtained from the ftp server
The file is also displayed.
6 、
{html_image file= ".. / path/relative/to/currdir/pumpkin.jpg" border= "1" height= "100" width= "100" alt= "picture" href= "1.html"}
Description: picture
7 、
{html_select_date}
Description: creation date drop-down menu. It can display any year, month and day.
{html_select_time}
Description: used to create a time drop-down menu. It can display any time, minute and second.
8 、
{html_table loop=$data cols=4 table_attr='border= "0" 'tr_attr=$tr td_attr=$td}
Description: form a 4-column table with $data array elements. Table_attl is the table attribute, tr_attr is the row attribute, and td_attr
Is a column attribute
9 、
{math equation= "x + y" x=$height y=$width}
Description: mathematical operation function
10 、
{mailto address= "me@domain.com" text= "send me some mail"}
Description: generate email link
11 、
{popup}
Description: to create a javascript pop-up window, you must call the popup_init function before using it.
This is the end of this article on "what are the common code snippets of smarty?". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.