Welcome Guest, Not a member yet? Register   Sign In
referring the library with another common name...
#1

[eluser]gops[/eluser]
I have created 3 different library.
Which I am loading dynamically based on user input.

like

$this->load->library($this->input->post("library_name"));


Now, How to call particular function of that loaded library , As I don't know the name
of the library ? OR how to convert string in to function ? ...

Things are confusing when you are from c/c++ background. ;-)

///Edit.

on the second thought , is following is possible ?

$bla = $this->load->library($this->input->post("library_name"));

$bla->sayhello();

I mean , Will loader class return anything when loading library ?
#2

[eluser]deviant[/eluser]
I think this might work:

Code:
$this->load->library($this->input->post("library_name"));

$this->$this->input->post("library_name")->some_function();

That or save the library name to a variable first:

Code:
$library = $this->input->post("library_name");

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

$this->$library->some_function();




Theme © iAndrew 2016 - Forum software by © MyBB