Php-Smarty-6 (23), phpsmarty-623
Next
10. html_options prints a set of options for select elements.
<Select name = customer_id>
{Html_options values = $ cust_ids selected = $ customer_id output = $ cust_names}
</Select>
<Option value = 'value'> text </option>
Values: array of Values
Output: Text Array
Selected: the value of the Selected item.
11. Print a group of radio buttons for html_radios.
Syntax:
{Html_radios values = $ cust_ids checked = $ customer_id output = $ cust_names separator = "<br/> "}
Values: array of Values
Output: Text Array
Separator: Separator
Checked: Value in the option
3. Configuration File
The configuration file helps the designer manage template global variables in the file. The simplest example is the template color variable. Generally, if you want to change the color of a program, you must change the color variable of each file. If you have this configuration file, the color variable can be saved in one place. You only need to change this configuration file to update your color.
Program Design
I. Constants
SMARTY_DIR
Ii. Variables
L $ template_dir: Template path
L $ compile_dir: Compilation path
L $ config_dir: configuration file path
L $ cache_dir: cache file path
L $ left_delimiter: Left Separator
L $ right_delimiter: Right Separator
L $ caching: whether to enable Cache
Public$ Caching =False;
The cache is enabled and closed by default, and can be directly setTrue,Enable Cache
L $ cache_lifetime: cache validity period (lifecycle)
Public$ Cache_lifetime = 3600;
The default value is3600Seconds,
L $ debugging open the debugging window
There are two ways to enable the debugging window:
1) in the template, use {debug}
2) in the program, use $ smarty-> debugging = true
Enabled in the program: You can see the variables allocated to the template
Enable in template: variables assigned to the template and custom variables of the template
L $ php_handling: In smarty2.6, to use the {php} flag, you must set the value of this option to true.