使用thinkphp5的時(shí)候,在同一個(gè)頁(yè)面下
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;
}
}
但是系統(tǒng)一直提示找不到adminsmodel類別
我懷疑過(guò)是命名空間的問(wèn)題,但是一時(shí)間也沒(méi)有解決方法,麻煩大家解答一下我的疑問(wèn)了
業(yè)精于勤,荒于嬉;行成于思,毀于隨。