codeigniter获取视图的值

时间:2013-02-05 05:59:36

标签: php codeigniter

如何获取加载视图的值?

$test = $this->load->view('testing',$data);

如何将$this->load->view('testing',$data);的内容传递给变量?

3 个答案:

答案 0 :(得分:2)

尝试这样.......

$test = $this->load->view('testing',$data,true);

整个视图将以$test字符串返回。

供参考,请浏览此链接

http://ellislab.com/codeigniter/user-guide/general/views.html

检查上述链接页面的末尾

答案 1 :(得分:1)

添加TRUE作为第三个参数:

$test = $this->load->view('testing',$data, TRUE);

答案 2 :(得分:1)

 $test = $this->load->view('testing',$data,true);