最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Windows下Smarty的安装
时间:2022-07-02 10:49:46 编辑:袖梨 来源:一聚教程网
YPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.***w3.org/TR/REC-html40/loose.dtd">
下载解压缩就不用说了
官方网站:http://smarty.p**h*p.net
php.net也有相关资料:http://news.*p*h*p.net/php.smarty.dev/2703
Installation - Windows, IIS/Apache, PHP5
Extract files, rename Smarty.x.x.x to smarty (suggest OUTSIDE of your www root!)
Example: D:smarty
Run phpinfo.php to find out your php.ini location
//这个phpinfo.php在哪里?没找着,不Run也罢,往下看。
Edit php.ini's include_path and add the location of the libs folder.
//修改php.ini 查找include_path这个字段,照下面的方式修改,目录名称及路径自己定义,只要与实际解压目录的路径相同就OK了。
example: include_path = ".;D:smartylibs"
Restart IIS/Apache
Setup these two folders INSIDE your www root:
//在WEB服务器根下建立templates和configs这两个文件(smarty目录也是自己建的)
(wwwroot)/smarty/templates (this is where your templates will go)
(wwwroot)/smarty/configs
Setup these two folders OUTSIDE of your www root:
//在smarty的解压目录建立templates_c和cache这两个目录。
D:/smarty/templates_c
D:/smarty/cache
Setup security settings for the webserver to write to these four folders
//templates 、configs 、templates_c 、cache 这四个目录必须是可写权限
In (wwwroot) create index.php and in (wwwroot)/smarty/templates/index.tpl with the following code:
//创建index.php及index.tpl两个文件测试Smarty是否安装成功,代码如下:
index.php:
pHP代码:
// load Smarty library
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'D:/inetpub/wwwroot/smarty/templates';
$smarty->config_dir = ' D:/inetpub/wwwroot/smarty/config';
$smarty->cache_dir = 'D:/smarty/smarty_cache';
$smarty->compile_dir = 'D:/smarty/smarty_templates_c';
$smarty->assign('name','fish boy!');
$smarty->display('index.tpl');
?>
index.tpl
复制内容到剪贴板
Hello, {$name}!
Now open index.php in your web browser (requested from your webserver)
//现在运行index.php,如果看到"Hello, fish boy!! "说明安装成功
相关文章
- 樱花动漫下载app安卓苹果最新版-樱花动漫手机客户端官方正版下载入口 02-16
- 钮祜禄梗是什么-钮祜禄梗的出处 02-16
- 妖精动漫网页版登录-妖精动漫官网一键登录 02-16
- 医学考试网官网入口-2026医师资格成绩查询入口 02-16
- 百度答题金手指入口不见了怎么进入-百度答题金手指玩法技巧 02-16
- 即梦官网网页版入口-即梦AI官方登录入口 02-16