用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1395|回复: 2
收起左侧

用 $this->db->query方法取出的数据怎么渲染到实图呢

[复制链接]
发表于 2013-11-27 09:56:47 | 显示全部楼层 |阅读模式
PHP复制代码
$query = $this->db->query("select * from aaa limit 0,10");//这里打印出来有数据
$this->ci_smarty->assign('kc',$query->result_array());//这里开始渲染
$this->ci_smarty->assign("title", "smarty模板技术");
$this->ci_smarty->display("test/Template.html");
复制代码

运行后报模板错误:Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template
我直接用smarty是没问题的,但在ci里调用会有这个错误
发表于 2013-11-28 00:24:02 | 显示全部楼层
这里说的是 Template.html 里有语法错误吧,这是 Smarty 报的,跟 CI 无关。
 楼主| 发表于 2013-11-27 21:34:43 | 显示全部楼层
嗯,原来多了一个空格

本版积分规则