帮忙解决一下这个问题来

hkjhkhkjjkk 2010-10-18 07:46:11
我的smarty已经连接好了 ,但是我这个写好之后,我在index.htm中写了“原始内容:{$name};”那么在index.php中应该显示“原始内容:it is a hard work,and you must keep on。”才对的,但是我的显示是“原始内容:$name.”
<?php
/*
* Created on 2010-10-18
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include("smarty_inc.php");
$value="it is a hard work,and you must keep on.";
$smarty->assign("name",$value);
$smarty->display("index.htm");



?>
请高手帮我看是怎么会事的,好像这个assign就没有起作用。
...全文
81 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
amani11 2010-10-19
  • 打赏
  • 举报
回复
注意:}}看出差别了吗?
f2i2t2e2r 2010-10-19
  • 打赏
  • 举报
回复
看下你的路径是否是正确的
zhang6464 2010-10-19
  • 打赏
  • 举报
回复
按理说你输出的内容应该是 原始内容:{$name}; 才对
zhang6464 2010-10-19
  • 打赏
  • 举报
回复
代码里的是全角符号,改为 原始内容:{$name} 就ok了
hkjhkhkjjkk 2010-10-18
  • 打赏
  • 举报
回复
<?php
include_once("smarty/smarty.class.php");
$smarty=new smarty();
$smarty->config_dir="smarty/config_file.class.php";
$smarty->caching=false;
$smarty->template_dir="./templates";
$smarty->compile_dir="./templates_c";
$smarty->cache_dir="./smarty_cache";
$smarty->left_delimiter="{";
$smarty->right_delimiter="}";





?>
heyli 2010-10-18
  • 打赏
  • 举报
回复
贴下你smarty_inc.php的代码

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧