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

CodeIgniter 求助 查过没有查到

[复制链接]
发表于 2013-7-23 17:50:35 | 显示全部楼层 |阅读模式
<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>这里的{elapsed_time}能自动替换
可是我的<title>{webTitle}</title>这个{webTitle}不能,
我在welcome.php中
    public function index()
    {

        $data = array(
        'webTitle' => 'My Title',
        'heading' => 'My Heading',
        'message' => 'My Message'
        );
        $this->load->view('welcome_message',$data);
    }

手册上是这样写的<title><?php echo $webTitle; ?></title>,这样写是可以的,可是我想用{webTitle}这种形式,简单
哪位指点下,谢谢

发表于 2013-7-24 10:47:24 | 显示全部楼层
模板解析器类

PHP复制代码
$this->parser->parse('welcome_message',$data);
复制代码
发表于 2013-7-25 10:56:01 | 显示全部楼层
本帖最后由 Raphael 于 2013-7-25 10:58 编辑

樓上正解{:soso_e100:}

本版积分规则