CodeIgniter Forums
call_user_func problem.... - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: call_user_func problem.... (/thread-28671.html)

call_user_func problem.... - El Forum - 03-18-2010

Hello !

I'm trying to write some kind scheduler/Cron library for my CI project. Now i'm stuck with call_user_func.

Jobs are stored in MySQL Db in format:

library name | method name(job) | params

Everything are stored as strings. I want to load libraries with $this->load->.... construction.

My question is, how can i invoke specified method from specified library ????

This construction won't work:

foreach ($q->result_array() as $r) {
    call_user_func( array($this, $this->CI->$r['library']->$r['job']), $r['params']);

call_user_func problem.... - El Forum - 03-18-2010

Heh, solution found: