Variables

PHP Smarty

Smarty - the compiling PHP template engine
Prev 来源:PHP中文社区 Next

Chapter 4. Variables[第四章.变量] 第四章.变量

Table of Contents[内容列表]
Variables assigned from PHP[从PHP分配的变量]
Variables loaded from config files[从配置文件读取的变量]
{$smarty} reserved variable[{$smarty} 保留变量]
{$Name} 

{$Contacts[row].Phone}

<body bgcolor="{#bgcolor#}">

Variables assigned from PHP
从PHP分配的变量

Table of Contents[内容列表]
Associative arrays[关联数组]
Array indexes[数组下标]
Objects[对象]
index.php:

$smarty = new Smarty;
$smarty->assign('firstname', 'Doug'); $smarty->assign('lastLoginDate', 'January 11th, 2001'); $smarty->display('index.tpl');
index.tpl: Hello {$firstname}, glad to see you could make it. <p> Your last login was on {$lastLoginDate}. OUTPUT: Hello Doug, glad to see you could make it. <p> Your last login was on January 11th, 2001.

Prev 来源:PHP中文社区 Home Next
Attributes
[属性]
Up Associative arrays
[关联数组]