gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 12:41:41 25 4
gpt4 key购买 nike

在 Codeigniter 中,我们如何在加载 View 后停止执行?

我试过了

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

//do not execute next code
}

但它会导致黑屏。

最佳答案

https://www.codeigniter.com/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 - 调用 $this->load->view() 后停止执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17317171/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com