This example describes the PHP template engine smarty built-in variable mediator usage. Share to everyone for your reference, specific as follows:
The variable mediator in Smarty is equivalent to a function, which is called by the following "|"
1.PHP (foreign name: Php:hypertext Preprocessor, Chinese name: "Hypertext Preprocessor") is a common open source scripting language. The grammar absorbs the C language, Java and Perl features, is conducive to learning, widely used, mainly for the
PHP tag style:
// Recommended tag style, which can be used in XML documents XML Style ';?> Short Style ';?> Asp Style '; %>
For example, "" will be treated as HTML because it is outside of the flag
['Name' ['name' ['name' ['name'];/*
Smarty commonly used 20 variable operators * Use syntax: {variable name | operator:}
* Capitalize---First letter capital
* Count_characters---count characters
* Cat---connection string
* Count_paragraphs---Calculation of paragraphs
* Count_sentences-
The 1.PHP code can consist of the following four parts:
Html
PHP tags
PHP statements
Space
PHP tags usually start with " "End.Four styles of 2.PHP markers
XML style: Order processed. ';? This is a recommended
PHP team: Google's website acceleration PHP skills are really nonsense. 51CTO quick translation] The Google team shared their website acceleration tips last week, including some PHP performance skills. However, these PHP performance skills have
Bkjia the Google Group last week shared its website acceleration tips, including some PHP performance tips. However, these PHP performance tips in the PHP community caused a stir, the PHP team immediately wrote an open letter to these performance
0x00 Serialization function
Serialize (): Returns a string with variable type and value
Unserialize (): Want to change the serialized string back to the value of PHP
Test code:
Class test{var $a;var $b;function __construct ($a, $b, $c) {$a = $a;$
BKJIA quick translation] The Google team shared their website acceleration tips last week, including some PHP performance skills. However, these PHP performance skills caused a storm in the PHP community, and the PHP team immediately wrote an open
The PHP template engine is widely used for separating templates and layouts.Using the PHP template engine, you can make the site's peacekeeping updates easy, create a better development environment, and make development and design work easier to
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.