最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
smarty include_php 加载php文件
时间:2022-07-02 10:46:26 编辑:袖梨 来源:一聚教程网
Example 7-21. function {include_php}
The load_nav.php file:
// load in variables from a mysql db and assign them to the template
require_once('database.class.php');
$db = new Db();
$db->query('select url, name from navigation order by name');
$this->assign('navigation', $db->getRows());
?>
在模板中我们如下设置
{* absolute path, or relative to $trusted_dir *}
{include_php file='/path/to/load_nav.php'}
{foreach item='nav' from=$navigation}
{$nav.name}
{/foreach}
相关文章
- 火影忍者怎么获得大招 05-03
- 星际战甲新手什么刀好 05-03
- 文明6秦始皇金字塔怎么加速 05-03
- 全民奇迹2龙骸巨剑怎么获得 05-03
- 星露谷物语鲟鱼怎么获得 05-03
- 长安幻想怎么转职 05-03