在使用thinkphp5的时候,在同一个页面下
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;
}
}
但是系统一直提示找不到adminsmodel类
我怀疑过是命名空间的问题,但是一时间也没有解决方法,麻烦大家解答一下我的疑问了
雷雷