I'm using Codeigniter 2.
Appreciate if someone could show the correct way to check if the following files :
You can use the native PHP function class_exists() to determine if the class has been defined, before calling it. In same regard, using method_exists() will check if class method exists.
Since helpers are collection of function, not methods, checking can be done using function_exists().
if (class_exists('Library'))
{
$this->library->myMethod();
}
For further info please refer to