Home > Backend Development > PHP Tutorial > Smarty built-in function config_load usage example, smartyconfig_load_PHP tutorial

Smarty built-in function config_load usage example, smartyconfig_load_PHP tutorial

WBOY
Release: 2016-07-13 10:09:17
Original
1069 people have browsed it

usage example of smarty built-in function config_load, smartyconfig_load

The example in this article describes the usage of smarty built-in function config_load. Share it with everyone for your reference. The details are as follows:

{config_load} is used to load configuration variables from the configuration file. Detailed usage is as follows:
Configuration file: foo.conf

Note: [Table] and [Customer] represent paragraph names.

Copy code The code is as follows:
[Table]
pageTitle = "this is mine"
bodyBgColor = "#eee"
tableBorderSize = 3
tableBgColor = "#bbb"
rowBgColor = "#ccc"

[Customer]
pageTitle = "Customer Info"

Template file: temp.htm

Copy code The code is as follows:
{config_load file="foo.conf"}
{#pageTitle#}
{#bodyBgColor#}

The first introduction method: error. If each section in the configuration file has a name, section="section name" must be added before it can be loaded into the variable.
Copy code The code is as follows:
{config_load file="foo.conf" section="Customer"}
{#pageTitle#}
{config_load file="foo.conf" section="Table"}
{#pageTitle#}

The second loading method is correct. Load the corresponding paragraph and introduce the corresponding variables.

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/946755.htmlTechArticlesmarty built-in function config_load usage example, smartyconfig_load This article describes the usage of smarty built-in function config_load. Share it with everyone for your reference. The details are as follows: {config_lo...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template