开发者

how to use another-model in a controller?

i want to use another model in a controll开发者_开发问答er for example in users_controller.php,we use a model as User how i can use another model for example sports_controller model as Sport?


In your controller:

$this -> loadModel ('Sports');

Then you can use it like any other model:

$this -> Sports -> find ('all');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜