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

PHP Code:
if(file_exists("../libraries/myapp/" ucfirst($library_name).".php")) { 

This code is not working for me.
It is written inside of a controller.

I have a default library and some special libraries.
If special libraries are just the controller names.

If they exist, they should be loaded. Or the default one should be loaded.

PHP Code:
if(file_exists("../libraries/myapp/" ucfirst($library_name).".php")) {
 
   $this->load->library("myapp/".$library_name);
}
else {
 
   $this->load->library("app_default_library");


What is the right way to check the existence of a library?
Reply


Messages In This Thread
How to check if a library exist in a controller? - by agriz - 04-29-2016, 09:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB