Php-Smarty-2 (19), phpsmarty-219. Php-Smarty-2 (19), phpsmarty-2191, delimiter lleft_delimiterlright_delimiterSmarty default delimiter is: {,} if you need to change, you can set the above two property templates for php-Smarty-2 (19), phpsmarty-219
1. delimiters
L left_delimiter
L right_delimiter
Smarty's default delimiter is: "{", "}"
If you need to change the attributes, you can set the above two attributes.
Template code:
Program code:
1. template variable assignment
Two parameters of the Assign method
1) template variable name
2) value
I. path settings
1. several common paths in Smarty
1) template path: template_dir
2) compilation path: compile_dir
3) configuration file path: config_dir
4) cache file path cache_dir
The preceding four paths are the four attributes of the smarty class.
2. in Smarty2.6, these attributes can be set outside the class
Class Smarty {
Var $ template_dir;
Var $ compile_dir;
Var $ config_dir;
Var $ cache_dir;
}
3. in Smarty3.0, this attribute is defined as follows:
Protected$ Template_dir
Protected$ Compile_dir
It is defined as a protected member, that is, we can inherit the smarty class and then have these protected members.
Here, we found that you can directly set these protected members.
If a value is assigned to a non-existent or inaccessible member, the set
When the value is set to a nonexistent or inaccessible member, get is automatically executed.
When values or values are assigned, first check whether the $ allowed array in the method defines the element. If yes, call the smarty method corresponding to the array element.
The code above shows that there are eight methods in smarty3.0 specifically for the values and assignments of these four attributes.
L setTemplateDir ()
L setCompileDir ()
L setConfigDir ()
L setCacheDir ()
L getTemplateDir ()
L getCompileDir ()
L getConfigDir ()
L getCacheDir ()
We recommend that you use the preceding method to set the path.
In the Smarty constructor, the default value is set for the preceding four attributes.
Use the above program to output the default path of smarty
Http://www.bkjia.com/PHPjc/993274.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/993274.htmlTechArticlephp-Smarty-2 (19), phpsmarty-219 1, delimiter l left_delimiter l right_delimiter Smarty default delimiter is: {,} if you need to change, you can set the above two attribute template generation...