1. Go to this page and download the library: Download txiki/callback library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Txiki\Callback\ICallable;
class MyObject implements ICallable
{
public function myMethod()
{
}
public function getCallable()
{
return function($id){
echo 'ok '.$id;
};
}
public function getParams()
{
return [999];
}
}
// return 'ok 999'
echo Call::dispatch(new MyObject());
php
e Txiki\Callback\Call;
use Txiki\Callback\CallableObject;
class DummyClass{
public function myMethod($foo, $bar)
{
return 'Out '.$foo.' - '.$bar;
}
}
$cObject = new CallableObject( 'DummyClass::myMethod' , ['foor', 'bar']);
// return 'Out foo - bar';
echo $result = Call::dispatch($cObject);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.