• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Load a model in my own created library

#1
[eluser]Unknown[/eluser]
<?php
class Mylib
{
function show_lib()
{
$obj=& get_instance();
$obj->load->module('login_check');
$var=$obj->login_check->get_all_table_data();
print_r($var);

}
}

?>

ERROR:-
Fatal error: Call to undefined method CI_Loader::module()

#2
[eluser]noideawhattotypehere[/eluser]
Code:
class Mylib {
    private $CI;

function __construct() {
        $this->CI =& get_instance();
}

function show_lib()
{
    $this->CI->load->model('login_check');
}



}

model/module depending on what you want to do (module if you using HMVC and you want full module loaded in, then use it like $this->CI->login_check->fnc();

#3
[eluser]Unknown[/eluser]
thanks man..


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.