我们可以在超薄框架的单个控制器中使用多个模型吗
can we use multiple models in single controller in slim framework
$this->app->post('/tech-master/stores/config/add', array($this, 'defaultConfig'));
$this->app->get('/tech-master/stores/config/edit/:userId', array($this, 'editConfigById'));
// Created obj of Users model
$this->userObj = new Users();
$this->storeObj = new Stores();
}
如何在 slim 框架的单个控制器中使用多个模型
是的,你可以。 Slim 不关心你在可调用路由中做了什么。
$this->app->post('/tech-master/stores/config/add', array($this, 'defaultConfig'));
$this->app->get('/tech-master/stores/config/edit/:userId', array($this, 'editConfigById'));
// Created obj of Users model
$this->userObj = new Users();
$this->storeObj = new Stores();
}
如何在 slim 框架的单个控制器中使用多个模型
是的,你可以。 Slim 不关心你在可调用路由中做了什么。