gpt4 book ai didi

php - CodeIgniter 中的 $this->load->view() 是什么

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:02:29 24 4
gpt4 key购买 nike

$this 用于当前类,view 是方法,load 是什么。这是属性(property)吗?

这个例子是否正确?

class super{

public $property;

public function superf1()
{
echo "hello";
}
public function col()
{
$this->superf1();
}

$this->property->super1();

}

最佳答案

是的,load 是一个属性。可以这样想:

class Loader {
public function view() {
//code...
}
}

class MyClass {
private $load;

public __constructor() {
$this->load = new Loader();
}

public someMethod() {
$this->load->view();
}
}

这种语法称为链接。

关于php - CodeIgniter 中的 $this->load->view() 是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35230932/

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