Php-Smarty-6 (23), phpsmarty-623

Source: Internet
Author: User

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.

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.