Smarty环境配置
从这里下载Smarty。
解压缩下载到的包,将解压缩后的目录名由Smarty.x.x.x修改为Smarty,并copy到想要安装的目录。如:
p:/Smarty。
修改php.ini文件的include_path设置,如:
include_path=".;P:\php-5.2.6\PEAR\pear;P:\Smarty\libs"
看个实际的例子:
打开Eclipse->File->New->PHP Project,命名为SmartyTest
假设我的Eclipse Workspace所在路径是:P:\EclipseWorkspace,那么PHP工程所在目录为:P:\EclipseWorkspace\SmartyTest
在其下创建目录Smarty,在其中再创建四个目录:
Smarty\templates
Smarty\templates_c
Smarty\cache
Smarty\configs
注:红色的必须创建并设置,以后再研究这几个目录的详细用途。
然后创建如下三个文件:
1. index.php在SmartyTest主目录下:









2. smarty_connect.php也在SmartyTest主目录下:





















3. index.tpl文件在Smarty\templates下






这样就可以了。