Welcome Guest, Not a member yet? Register   Sign In
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..




Theme © iAndrew 2016 - Forum software by © MyBB