php – 调用$this-> load-> view()后停止执行

前端之家收集整理的这篇文章主要介绍了php – 调用$this-> load-> view()后停止执行前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在Codeigniter中,我们如何在加载视图后停止执行?

我试过这个

function index() {
    $this->load->view('myView');
    die();

    //do not execute next code
}

但它导致了空白屏幕.

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

There is a third optional parameter lets you change the behavior of the function so that it returns data as a string rather than sending it to your browser. This can be useful if you want to process the data in some way.

echo $this->load->view('myView','',TRUE);
    die();

猜你在找的PHP相关文章