FredGarcia / rolling-curl

Automatically exported from code.google.com/p/rolling-curl
0 stars 0 forks source link

It would be nice to can use as callback class method. #19

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be nice to can use as callback class method. It is quite easy to 
implement.

class RollingCurl {
...
function __construct($callback = null, $instance = null) {
  $this->instance = $instance;
  $this->callback = $callback;
}
}

and then call it like this:

if($instance){
  $this->instance->$callback;
} else if(is_callable($callback)){
  call_user_func($callback,...);
}

thank you.

Original issue reported on code.google.com by hhhhe...@gmail.com on 1 Mar 2011 at 12:40

GoogleCodeExporter commented 8 years ago
Sorry for bothering you.
It alredy do the call_user_func(). I should read manual before posting.

Original comment by hhhhe...@gmail.com on 1 Mar 2011 at 12:56