热门关键字:  ubuntu  分区  Fedora  linux系统进程  函数

当前位置 :| 主页>Linux教程>编程开发>PHP>

Windows环境下smarty安装最简明教程

来源: 作者: 时间:2007-11-24 Tag: 点击:


$smarty = new Smarty;

//下面的(你的网站目录)用绝对路径,可以用相对路径(./templates)
$smarty->template_dir='C:\Apache2\htdocs\mysmarty\templates';
$smarty->config_dir='C:\Apache2\htdocs\mysmarty\configs';
$smarty->cache_dir='C:\Apache2\htdocs\mysmarty\cache';
$smarty->compile_dir='C:\Apache2\htdocs\mysmarty\templates_c';
//上面四行为使用Smarty前的必要参数配置

$smarty->assign('name','明天');
$smarty->display('index.tpl');
?>

index.tpl
<html>
<body>
你好,{$name}!
</body>
</html>

7、现在终于可以浏览自己的作品。运行index.php

最新评论共有 4 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
栏目列表
热点关注
相关文章