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');
精彩评论