efficient when writing sites that support multiple languages, such as using echo and print to visualize the workload. Do not worry, skilled use of fasttemplate will take up part of your time, but these times will be in your future work to make up for back, especially when the big project. So, how do you use Fasttemplate? The first step is simply to use the function
, where path points to the path where the template directory resides. This function establishes a $
specified location (if scientific counts are e;)
%, when there is a format flag in the string, a percent sign is required
?
1234567891011
tpl = "i am %s" % "alex"tpl = "i am %s age %d" % ("alex", 18)tpl = "i am %(name)s age %(age)d" % {"name": "alex", "age": 18}tpl = "percent %.2f" % 99.97623
-adjust convert integers, floating-point numbers to floating-point or scientific notation (more than 6 digits in scientific notation), and format them to a specified location (if scientific counts are e;)
G, auto-adjust convert integers, floating-point numbers to floating-point or scientific notation (more than 6 digits in scientific notation), and format them to a specified location (if scientific counts are e;)
%, when there is a format flag in the string, a percent sign is required
languages, after learning one language, you can easily master other languages. The main reason for using the template engine is to separate front-end engineers from backend engineers. Therefore, the template engine is not only used by backend engineers, but also by front-end engineers.
1. use of the template engine by backend engineers
The PHP script contains the file where the template engine class is located. As follows:
Require ("mytpl. class. php"); // contains the template engine class, wh
Please help me to use the smarty template by checking Warning: Smartyerror: unabletoreadresource: This post was last edited by tiancai784071179 from 2015-05-2115:08:47: I checked it with $ tpl- gt; template_dir, the template directory is correct. why do you want to help use the smarty template? Warning: Smarty error: unable to read resource:
This post was last edited by tiancai784071179 at 15:08:47Template directory: I used $
ASP has two types of scripts: VBScript and JScript. They all contain a "RegExp object" (RegExp). Using string objects and RegExp objects, you can easily implement the template function. Mu Feng wrote a "Template. JScript. INC" file. The content of this file is attached to the end of the article. Competent readers can make improvements based on their own needs.
The following describes how to use it. Because this file is written in JScript (of course, it is easy to convert it to VBScript), the de
PHP has a template program (fasttemplate), the problem now is how to implement similar functions in ASP.Microsoft's ASP comes with two kinds of scripts: VBScript and JScript. They all carry a "regular Expression object" (REGEXP) that makes it easy to implement template functionality with string objects and RegExp objects. Mu Maple to write a "Template.JScript.INC" file, the contents of this file attached to the post. The ability of the reader can be based on their own needs to improve.
Here's
(fasttemplate), the problem now is how to implement similar functions in ASP.
Microsoft's ASP comes with two kinds of scripts: VBScript and JScript. They all carry a "regular Expression object" (REGEXP) that makes it easy to implement template functionality with string objects and RegExp objects. Mu Maple to write a "Template.JScript.INC" file, the contents of this file attached to the post. The ability of the reader can be based on their own needs to improve.
Here's how to use this. Because th
CentOS Linux 7 (Core), 64-bit
Packages
JDK 7 or higher, Oracle JDK 6 update
No pre-installed Tomcat and MySQL
RAM
4 GB
8 GB recommended
CPU
2.0 GHZ or higher
Hard Disk
30 GB, at least 5 GB
To install Zephyr, you must have the root permission and make sure that you have correctly configured the static IP address of the network. The default port must be available and allow access through the firewall. Specifically, tomcat uses por
song is considered to be the most different from a flute Group)Meditation Masne (romantic French style)Grieg (fresh and beautiful sketch)Alpini Board (SAD, heavy)
The above are some of your favorite nice songs, including classical and modern ones (I'm tired)But it's really nice. In addition, if you like classical music, you can watch the TV animated golden Piano String, Which is exclusive to many famous songs.Qiu bit instrumentalHttp://www.cstszx.net/jiaoshi/gaojunying/music/qiu%20bi%20te.mp3
B
Smarty scripts and can only be used once in a script, which is responsible for obtaining and displaying templates referenced by the Smarty engine
Prototype: var display (string template[,string cache_id][,string compile_id])
Parameter one: template is required, specifies the type and path of a legitimate template resource
Parameter two: cache_id specifies the name of a cached identifier
Parameter three: COMPILE_ID is used when maintaining multiple caches on a page
Use the following methods
$TPL =new Smarty ()//New Smarty object, I'm using the Smarty-3.1.6 version
1. Set Smarty template path $tpl->settemplatedir (); By default, templates
2. Set the Smarty template compilation Path $tpl->setcompiledir (); By default, Templates_c
3. Set the left and right delimiters of the Smarty template engine,
The code is as follows
Copy Code
$TPL =new Smarty ()//New Smarty object, I'm using the Smarty-3.1.6 version
1. Set Smarty template path $tpl->settemplatedir (); By default, templates
2. Set the Smarty template compilation Path $tpl->setcompiledir (); By default, Templates_c
3. Set the left and right delimiters of the Smarty template engine,
The code is as follows
Copy Code
(fasttemplate), the problem now is how to implement similar functions in ASP.
Microsoft's ASP comes with two kinds of scripts: VBScript and JScript. They all carry a "regular Expression object" (REGEXP) that makes it easy to implement template functionality with string objects and RegExp objects. Mu Maple to write a "Template.JScript.INC" file, the contents of this file attached to the post. The ability of the reader can be based on their own needs to improve.
Here's how to use this. Because th
Copy CodeThe code is as follows:
Class Lightpage_template {
var $Tpl _header;
var $Tpl _footer;
var $Tpl _parsing;
var $Tpl _template;
var $Tpl _dirname;
var $Tpl _parse_string;
var $Tpl
PHP question [urgent] [urgent] [urgent] [urgent] Please help me with template assignment
The final page code is as follows:
Assign ("show", 'success '); $ show = '000000'; include ('Templates/index.html '); ==================================== if you write this code in this way, $ show can be assigned a value // include ('F: /AppServ/www/temp/tpl/com_index.html.php '); // $ tpl-> compile('index.html ');
$TPL =new Smarty ()//New Smarty object, I'm using the Smarty-3.1.6 version1. Set smarty template path $tpl->settemplatedir (); By default, templates2. Set the Smarty template compilation path $tpl->setcompiledir (); By default, Templates_c3. Set the left and right delimiters of the Smarty template engine,
$tpl->left_d
displaying the template referenced by the Smarty enginePrototype: var display (string template[,string cache_id][,string compile_id])Parameter one: template is required and specifies the type and path of a legitimate template resourceParameter two: cache_id specifies the name of a cache identifierParameter three: COMPILE_ID used when maintaining multiple caches on a pageUse the following method$smarty->display (' tpl/template_dir/template.html ');Sim
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.