Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Missing __isset function in CI_Model #1791

Closed
mathijsgiesbers opened this Issue · 1 comment

2 participants

@mathijsgiesbers

The CI_Model is missing the __isset function. When using the isset function to check if an library or so is available the isset method returns wrong output.

the fix is to add to following code:

function __isset($key)
{
    $CI =& get_instance();
    return isset($CI->$key);
}
@narfbg
Owner

This indeed would allow checking for loaded libraries, but it would also introduce false-positives and return TRUE for non-library properties that exist in the controller - we don't want that.

$this->load->library('<library_name>'); won't re-load a library that has already been instantiated, so you can just use that in order to be sure if it's loaded or not.

@narfbg narfbg closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.