Welcome Guest, Not a member yet? Register   Sign In
Loading library from name
#1

Hi,

I have trouble to use a library that I load depending on a variable data.

$mylibrary = 'Custom_Lib';
$mymethod = 'Method1';
//those two are retreived from a database.

//After I use the method:

$this->load->library($mylibrary);
$this->$mylibrary->$method();

//I have an error that I'm calling a method on a non object...

I've tried also
class_alias(strtolower($mylibrary), 'useclass');
$this->useclass->$method($record);

//same problem...

Any one have an advise to call a special library/method from dynamicly ?

Thanks for your help,

Yannick
Reply


Messages In This Thread
Loading library from name - by yad - 07-14-2015, 02:30 PM
RE: Loading library from name - by CroNiX - 07-14-2015, 05:27 PM
RE: Loading library from name - by yad - 07-14-2015, 11:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB