Welcome Guest, Not a member yet? Register   Sign In
Split library into 2 versions, 'light' and 'complete', then call functions from either using just 1 library name.
#4

[eluser]wh1tel1te[/eluser]
[quote author="InsiteFX" date="1299182457"]wh1tel1te,

You can pass an array to the library but you cannot give it a different name!
You can only do that with CI Models.

Code:
$this->load->library('my_complete_library', $array);

InsiteFX[/quote]
You enter the custom library name as the third parameter, not the second, which is an array as you suggest. Have a closer look at my code again. In your case:

Code:
$this->load->library('my_complete_library', $array, 'my_custom_lib_name');
$this->my_custom_lib_name->some_function();

Just tested with one of my own libraries (CI 2.0), works fine.

Code:
$this->load->library('Flexauth', '', 'jujubee');
if ($this->jujubee->is_logged_in() == TRUE)
{
    echo 'Logged in';
} else
{
    echo 'Not logged in';
}

No errors. Outputted text as expected.


Messages In This Thread
Split library into 2 versions, 'light' and 'complete', then call functions from either using just 1 library name. - by El Forum - 03-03-2011, 01:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB