tml): 占位符(PLACEHOLDER)对应数组,“.”对应数组“[]”
[code:1:b920254608]Admin Name: {admin.NAME}
Admin Age: {admin.AGE}
Guest Name: {guest.NAME}
Guest Age: {guest.AGE}[/code:1:b920254608]
输出:
[code:1:b920254608]Admin Name: John Doe
Admin Age: 42
Guest Name: Roger Rabbit
Guest Age: 16[/code:1:b920254608]
[b:b920254608]例子6: 命名空间, 3个部分[/b:b920254608]
[code:1:b920254608]<?php
$template = new SmartTemplate('template.html');
$content['world']['europe']['germany'] = 'DE';
$template->assign( 'top_level_domain', $content );
$template->output();
?>[/code:1:b920254608]
模板(template.html): 占位符(PLACEHOLDER)对应数组,“.”对应数组“[]”
[code:1:b920254608]<html> German TLD: {top_level_domain.world.europe.germany} </html>[/code:1:b920254608]
输出:
[code:1:b920254608]<html> German TLD: DE </html>[/code:1:b920254608]
[b:b920254608]例子7: 列表赋值[/b:b920254608]
[code:1:b920254608]<?php
$links = array(
&n
[code:1:b920254608]Admin Name: {admin.NAME}
Admin Age: {admin.AGE}
Guest Name: {guest.NAME}
Guest Age: {guest.AGE}[/code:1:b920254608]
输出:
[code:1:b920254608]Admin Name: John Doe
Admin Age: 42
Guest Name: Roger Rabbit
Guest Age: 16[/code:1:b920254608]
[b:b920254608]例子6: 命名空间, 3个部分[/b:b920254608]
[code:1:b920254608]<?php
$template = new SmartTemplate('template.html');
$content['world']['europe']['germany'] = 'DE';
$template->assign( 'top_level_domain', $content );
$template->output();
?>[/code:1:b920254608]
模板(template.html): 占位符(PLACEHOLDER)对应数组,“.”对应数组“[]”
[code:1:b920254608]<html> German TLD: {top_level_domain.world.europe.germany} </html>[/code:1:b920254608]
输出:
[code:1:b920254608]<html> German TLD: DE </html>[/code:1:b920254608]
[b:b920254608]例子7: 列表赋值[/b:b920254608]
[code:1:b920254608]<?php
$links = array(
&n
| 对此文章发表了评论 |
