how to require_once in codeigniter

前端 未结 4 739
醉梦人生
醉梦人生 2020-12-09 03:56

I am trying to extend a library in codeigniter. The only way to do so seems to include the original library using require_once then load the extended library us

4条回答
  •  死守一世寂寞
    2020-12-09 04:38

    If the library is a codeigniter specific library, as sbaaaang points out, you should use:

    $this->load->library('ion_auth');
    

    However, if the library is just a generic PHP class or set of functions, the codeiginter loader may not recognize it. Then you will need to use either one of the generic loading operators (include, include_once, require, require_once), with the APPPATH constant, as also pointed out:

    require_once(APPPATH.'libraries/ion_auth.php');
    

提交回复
热议问题