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.
http://www.bkjia.com/PHPjc/946755.htmlwww.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...