I. Comments in the template
Each smarty template file is developed using the syntax of the web foreground language (xhtml,css, JavaScript, etc.) combined with the Smarty engine.
The web foreground is developed in the same language as the original,
The foreachelese function indicates the code executed when the array does not have any data.
Part 1 (Portal): Introduction and entry to the smarty Template------------------------ New content ------------ Smarty template design Article 4. built-in
In this paper, the use of Smarty template is analyzed in detail, which has a certain reference value for learning Smarty friends. Details are as follows:
I. comments in the template
Each smarty template file is developed using the syntax of the web
It is estimated that many children who play smarty template have encountered the problem of cutting garbled characters. Especially the UTF8 encoded.
The following code is saved as modifier.truncate2.php to the plugin directory under Smarty Libs
And
When extracting FCKeditor, use the following
PHP uses $_post[' P_info '] to get the value of FCKeditor
Add:
1. The path to basepath here must be the same as the path of the include above. You will not find the file)
In addition, for this input
PHP designers, who are just beginning to touch the template engine, will find it hard to hear Smarty. In fact, the author is no exception, touch all dare not touch a bit. But later in the anatomy of XOOPS's program architecture, it is not difficult
First, the use of GetText, because Smarty have the corresponding GetText plug-in, so directly with the plug-in
The steps are as follows:
1.1 Add the following code to the common include file:
$domain _info[' Lang '] is the language set
PHP is an embedded HTML scripting language, in order to separate the HTML and PHP code, the so-called logical layer and the presentation layer, which is the purpose of the template engine. In order to achieve this goal, the template engine has the
Visit 127.0.0.1/smarty/test/test.php A blank there's nothing there
Chrome Console Report Server 500
But there's no such error in Chrome's stealth version.
Don't know what reason, little white help.
The test.php code is as follows
//引用处
//被引用文件内容
Results:
Why is there more than one line of empty text here? Makes the content of my page move down a lot
Reply content:
//引用处
//被引用文件内容
On the net to see is the front and back end of the separation, easy to set data, but I feel is smarty syntax is more complex, no PHP basic syntax is simple, feel direct to write PHP is simpler, do not know what the role of using Smarty?
Reply
Method of Smarty Area loop in PHP, Phpsmarty area loop
The example in this paper describes the method of Smarty area loop in PHP. Share to everyone for your reference. The implementation method is as follows:
Smarty Test
PHP designers who are new to the template engine will find it difficult to hear about Smarty. In fact, I don't dare to touch it. However, when analyzing the XOOPS program architecture, it began to find that Smarty is actually not difficult. As long
However, according to my test, if you do not delete a place, the generated document will be opened in Excel and an error will be reported!
Delete all strings like this: SS: expandedcolumncount = "5!
Example:
Enter the data and submit it. An
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.