gpt4 book ai didi

php - 代码点火器 : A lot of function in the same controller

转载 作者:行者123 更新时间:2023-11-29 13:44:49 25 4
gpt4 key购买 nike

我是 codeigniter 的新手,我刚刚学会使用 codeigniter 已经两周了。我在一个 Controller 中使用超过 26 个功能,每个功能加载不同的 View 。我的问题是,当我加载此 Controller (XXX.php)中的函数 X 时,是否仅加载了 X 函数?或所有 Controller (所有文件 XXX.php),恐怕它会使网站加载时间太长?

最佳答案

您的 Controller 将在运行之前被解析(与所有 PHP 一样),但它只会调用特定的函数。

要对正在发生的事情有一个模糊的了解,您可以使用:

$this->output->enable_profiler(TRUE);

在您的一个函数中然后调用它......它将在页面底部显示分析器。

有关探查器的更多信息,请访问:http://ellislab.com/codeigniter/user-guide/general/profiling.html

希望这有帮助:)

关于php - 代码点火器 : A lot of function in the same controller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17582094/

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