Home >Backend Development >PHP Tutorial >php—Smarty-6 (23), phpsmarty-623_PHP Tutorial

php—Smarty-6 (23), phpsmarty-623_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 09:54:41768browse

php—Smarty-6 (23), phpsmarty-623

Continued from the previous article

10. html_options Print a set of options for select elements

Values: array of values

Output: array of text

Selected: The value of the selected item

php—Smarty-6 (23), phpsmarty-623_PHP Tutorial11. html_radios prints a set of radio buttons

Syntax:

{html_radios values=$cust_ids checked=$customer_id output=$cust_names separator="
"}

Values: array of values

Output: array of text

Separator: separator

Checked: the value in the option

php—Smarty-6 (23), phpsmarty-623_PHP Tutorial3. Configuration file

Configuration files help designers manage template global variables in files. The simplest example is the template color variable. Generally, if you want to change the appearance color of a program, you must change the color variable of each file. If there is this configuration file, the color variables can be saved in one place, and you can update your colors by simply changing this configuration file.

php—Smarty-6 (23), phpsmarty-623_PHP TutorialProgramming

1. Constants

SMARTY_DIR

2. 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 delimiter

l $right_delimiter: right delimiter

l $caching: Whether to enable caching

public $caching = false;

The cache is turned on and off by default. You can directly set it to true, enable the cache function

l $cache_lifetime: cache validity time (life cycle)

public $cache_lifetime = 3600;

 The default is 3600 seconds,

l $debugging Open debugging window

There are two ways to open the debugging window:

1) In the template, use {debug}

2) In the program, use $smarty->debugging=true

Open in the program: you can see the variables assigned to the template

Open in template: variables assigned to the template, variables customized by the template

l $php_handling: In smarty2.6, if you want to use the {php} tag, the value of this option must be set to true

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/995281.htmlTechArticlephp—Smarty-6 (23), phpsmarty-623 Continued from the previous article 10. html_options is used to print a set of options. In the select element select name=customer_id {html_options values=$cust_idsselected=$custom...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn