Welcome Guest, Not a member yet? Register   Sign In
Using libraries in models
#2

[eluser]Jelmer[/eluser]
Code:
$ci =& get_instance(); // it's better to remove the & in PHP5, will cause a notice on PHP 5.3 and up
$ci->load->library('lib_name');

$val = $ci->lib_name->some_function();

Alternate option for PHP5:
Code:
get_instance()->load->library('lib_name');
$val = get_instance()->lib_name->some_function();

-------------------------

Edit: never mind, this is for using libraries in libraries. When using them in models you can use them like in controllers.


Messages In This Thread
Using libraries in models - by El Forum - 09-03-2010, 12:55 PM
Using libraries in models - by El Forum - 09-03-2010, 01:27 PM
Using libraries in models - by El Forum - 09-03-2010, 01:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB