configuration - codeigniter correct way to check if libraries/helper/core files is loaded -


i'm using codeigniter 2.

appreciate if show correct way check if following files :
- library file loaded?
- helper file loaded?
- config file loaded?
- model file loaded?
- third_party file loaded?

regards

you can use native php function class_exists() determine if class has been defined, before calling it. in same regard, using method_exists() check if class method exists.

since helpers collection of function, not methods, checking can done using function_exists().

if (class_exists('library'))  {     $this->library->mymethod(); } 

for further info please refer

http://php.net/manual/en/function.class-exists.php.

http://us.php.net/manual/en/function.method-exists.php


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -