Php 浏览器没有';我不理解聪明的人

Php 浏览器没有';我不理解聪明的人,php,codeigniter,smarty,Php,Codeigniter,Smarty,我从下载了Smarty+codeigniter包,但browset没有从php解释变量ASSOCIATE。我在config/autoload中加载了库Smarty,但我无法找出问题出在哪里。有什么建议吗 在php中,我有: public function index() { $this->smarty->assign('test','This is a test'); $this->smarty->display('example.tpl

我从下载了Smarty+codeigniter包,但browset没有从php解释变量ASSOCIATE。我在config/autoload中加载了库Smarty,但我无法找出问题出在哪里。有什么建议吗

在php中,我有:

public function index()
{ 
        $this->smarty->assign('test','This is a test');
        $this->smarty->display('example.tpl');
}
在example.tpl中:

{$test}

浏览器返回{$test}而不是这是一个测试。

你读过github项目的自述文件吗?它表示要使用以下代码分隔符:

而不是:

{$FirstName}
报价的直接副本:

Smarty中的默认模板代码分隔符可能会导致一些问题

所以{smarty\u variable}变成[~smarty\u variable~]

它有点冗长,但不必使用{literal} 每次需要在.tpl文件中添加Javascript时,都会添加标记

{$FirstName}