use Think\Model;
class ClientModel extends Model{
}
然后在同模块的Controller的IndexController.class.php文件下namespace Api\Controller;
use Think\Action;
use Api\Model\ClientModel;
class IndexController extends Action {
protected function _initialize(){
$this->model = new ClientModel;
}
报Class 'Api\Model\ClientModel' not found,错误。这是不是用了USE后就不需要new了,可是我想在_initialize下来根据判断实例化某个模型。是那里错了啊!
最佳答案