gpt4 book ai didi

php - 使用 php 在 __construct 中调用函数

转载 作者:可可西里 更新时间:2023-10-31 22:06:38 24 4
gpt4 key购买 nike

一个我找不到答案的简单 PHP 问题。

是否可以从“__construct()”调用函数?

例如,如果我使用 My_Controller 解决方案 here .如果我在下面添加自己的函数,比如我有更高级的身份验证,我可以从构造中调用它吗?

最佳答案

是的,使用格式 $this->myNewFunction();

关于php - 使用 php 在 __construct 中调用函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6533724/

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