//定义是mycontroller.php
message === null) { $this->message = 'hello world'; }}public function run(){ return html::encode($this->message);}
}
//然后调用是在view中
= hellowidget::widget(['message' => 'good morning']) ?>
//结果报错找不到组件
class 'appcomponentshellowidget' not found
请问我定义是不是错了呀?
回复内容: //定义是mycontroller.php
message === null) { $this->message = 'hello world'; }}public function run(){ return html::encode($this->message);}
}
//然后调用是在view中
= hellowidget::widget(['message' => 'good morning']) ?>
//结果报错找不到组件
class 'appcomponentshellowidget' not found
请问我定义是不是错了呀?
命名空间的问题
很少用app开始的明明空间,一般都是common/components;或者根据模块来,frontend backend