When using thinkphp5, on the same page
namespace app\index\model;
use think\Model;
// 此处$target='admins';$behaviour='nihao';
class Firstrow{
public function mainChoose($target,$behaviour){
$tableName = $target.'model';
$openGate = new $tableName();
return $result = $openGate -> $behaviour();
}
}
class adminsmodel extends Model{
protected $table = 'admins';
public function nihao(){
$result = $this->select()->collection()->toArray();
return $result;
}
}
But the system keeps prompting that the adminsmodel class cannot be found
I suspected that it was a namespace problem, but there was no solution for a while. Could you please answer my questions
业精于勤,荒于嬉;行成于思,毁于随。