Welcome Guest, Not a member yet? Register   Sign In
How to check if a library exist in a controller?
#2

Check if object is available:

PHP Code:
$is_loaded is_object(@$this->upload) ? TRUE FALSE;// @ sign suppressed error if object didn't exist
var_dump($is_loaded);
exit; 

Now you just need to make your own method that take a parameter as name of library:

PHP Code:
private function is_lib($lib)
{
 
¬† ¬†return is_object(@$this->{$lib}) ? TRUE FALSE;


PHP is_object function.
Reply


Messages In This Thread
RE: How to check if a library exist in a controller? - by Tpojka - 04-29-2016, 04:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB