Using libraries in models |
[eluser]tuope[/eluser]
Hello! I have read the "Creating Libraries" page (http://ellislab.com/codeigniter/user-gui...aries.html). How do you use library classes in models? The page mentions using library classes only in controllers. Thanks for the help! Tuomas
[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 Alternate option for PHP5: Code: get_instance()->load->library('lib_name'); ------------------------- Edit: never mind, this is for using libraries in libraries. When using them in models you can use them like in controllers.
|
Welcome Guest, Not a member yet? Register Sign In |