Smarty配置出错了,help
时间:2010-08-16
来源:互联网
我第一次接触Smarty,求帮助
1 <?php
2 require"smarty/libs/Smarty.class.php";
3 $smarty = new Smarty;//设置各个目录的路径,这里是安装的重点
4 $smarty->template_dir ="smarty/templates/templates";
5 $smarty->compile_dir = "smarty/templates/templates_c";
6 $smarty->config_dir = "smarty/templates/config";
7 $smarty->cache_dir ="smarty/templates/cache"; //smarty模板有高速缓存的功能,如果这里是true的话即打开caching,但是会造成网页不立即更新的问题,当然也可以通过其他的办法解决
8 $smarty->caching = false;
9 $hello = "Hello World!";//赋值
10 $smarty->assign("hello",$hello);//引用模板文件
11 $smarty->display('index.html');
12 ?>
错误信息如下:
Parse error: syntax error, unexpected T_VARIABLE in F:\XAMPP\xampp\htdocs\DreamWaver PHP\PHP\learn\index.php on line 5
是什么原因呀?
1 <?php
2 require"smarty/libs/Smarty.class.php";
3 $smarty = new Smarty;//设置各个目录的路径,这里是安装的重点
4 $smarty->template_dir ="smarty/templates/templates";
5 $smarty->compile_dir = "smarty/templates/templates_c";
6 $smarty->config_dir = "smarty/templates/config";
7 $smarty->cache_dir ="smarty/templates/cache"; //smarty模板有高速缓存的功能,如果这里是true的话即打开caching,但是会造成网页不立即更新的问题,当然也可以通过其他的办法解决
8 $smarty->caching = false;
9 $hello = "Hello World!";//赋值
10 $smarty->assign("hello",$hello);//引用模板文件
11 $smarty->display('index.html');
12 ?>
错误信息如下:
Parse error: syntax error, unexpected T_VARIABLE in F:\XAMPP\xampp\htdocs\DreamWaver PHP\PHP\learn\index.php on line 5
是什么原因呀?
作者: @wenzi 发布时间: 2010-08-16
<?php
/*
* Created on 2007-5-14
* Programmer : Alan , Msn - [email protected]
* PHP100.com Develop a project PHP - MySQL - Apache
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include_once('./class/Smarty.class.php');
//******************
$smarty = new smarty();
$smarty->template_dir = "./templates";
$smarty->compile_dir = "./templates_c";
$smarty->config_dir = "./config";
$smarty->cache_dir = "./cache";
$smarty->caching = false;
$smarty->left_delimiter = "<%{";
$smarty->right_delimiter = "}%>";
?>
这是我配置的类文件 你看看 你文件名正确不
/*
* Created on 2007-5-14
* Programmer : Alan , Msn - [email protected]
* PHP100.com Develop a project PHP - MySQL - Apache
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include_once('./class/Smarty.class.php');
//******************
$smarty = new smarty();
$smarty->template_dir = "./templates";
$smarty->compile_dir = "./templates_c";
$smarty->config_dir = "./config";
$smarty->cache_dir = "./cache";
$smarty->caching = false;
$smarty->left_delimiter = "<%{";
$smarty->right_delimiter = "}%>";
?>
这是我配置的类文件 你看看 你文件名正确不
作者: jerrymsj 发布时间: 2010-08-16

作者: ferss 发布时间: 2010-08-16
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28