PHP Manual

PEAR Manual

Smarty Manual

PostgreSQL

MySQL Manual

Perl Manual

variables loaded from config files

variables that are loaded from the config files are referenced by enclosing them within hash marks (#), or with the smarty variable $smarty.config. the second syntax is useful for embedding into quoted attribute values.

example 4-5. config variables

foo.conf:

pagetitle = "this is mine" bodybgcolor = "#eeeeee" tablebordersize = "3" tablebgcolor = "#bbbbbb" rowbgcolor = "#cccccc"

index.tpl:

{config_load file="foo.conf"} <html> <title>{#pagetitle#}</title> <body bgcolor="{#bodybgcolor#}"> <table border="{#tablebordersize#}" bgcolor="{#tablebgcolor#}"> <tr bgcolor="{#rowbgcolor#}"> 	<td>first</td> 	<td>last</td> 	<td>address</td> </tr> </table> </body> </html>

index.tpl: (alternate syntax)

{config_load file="foo.conf"} <html> <title>{$smarty.config.pagetitle}</title> <body bgcolor="{$smarty.config.bodybgcolor}"> <table border="{$smarty.config.tablebordersize}" bgcolor="{$smarty.config.tablebgcolor}"> <tr bgcolor="{$smarty.config.rowbgcolor}"> 	<td>first</td> 	<td>last</td> 	<td>address</td> </tr> </table> </body> </html>

this will output for both examples:

<html> <title>this is mine</title> <body bgcolor="#eeeeee"> <table border="3" bgcolor="#bbbbbb"> <tr bgcolor="#cccccc"> 	<td>first</td> 	<td>last</td> 	<td>address</td> </tr> </table> </body> </html>

config file variables cannot be used until after they are loaded in from a config file. this procedure is explained later in this document under {config_load}.

see also variables and $smarty reserved variables