2016-02-09 11:30 阅读 38


I am having two controllers hrcontroller and admincontroller.

And models hrmodel and adminmodel.

It is possible to access a method in hrmodel from admincontroller. ?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    doucan1979 doucan1979 2016-02-09 11:52

    in your admincontroller you just do this

    //replace get_data for a real function on your model

    you can load all models you want doing this.

    点赞 评论 复制链接分享
  • douliu1092 douliu1092 2019-03-27 09:36

    This answer did not work for me. Heres what worked out for me:

    $this->load->model('hrcontroller/hrmodel'); $this->hrmodel->myfunction();

    点赞 评论 复制链接分享