Yii中,可以这样创建生成一个对象:$response = new yii\web\Response;
$response = new yii\web\Response;
$response->on('beforeSend', funciton($event){
//
});
这里没有括号(new yii\web\Response();
),这是怎么做到的呢?
这个是初始化一个对象没错吧?
Yii中,可以这样创建生成一个对象:$response = new yii\web\Response;
$response = new yii\web\Response;
$response->on('beforeSend', funciton($event){
//
});
这里没有括号(new yii\web\Response();
),这是怎么做到的呢?
这个是初始化一个对象没错吧?
1 回答4.1k 阅读✓ 已解决
3 回答1.9k 阅读✓ 已解决
2 回答2.3k 阅读✓ 已解决
1 回答1.4k 阅读✓ 已解决
2 回答2.2k 阅读
1 回答629 阅读✓ 已解决
802 阅读
如果构造函数没有必传参数的话是可以的