发布于 2015-08-09 09:41:49 | 313 次阅读 | 评论: 0 | 来源: 网络整理
$server->on('Request', function ($req, $resp) {
echo "hello world";
});
class A
{
static function test($req, $resp)
{
echo "hello world";
}
}
$server->on('Request', 'A::Test');
$server->on('Request', array('A', 'Test'));
function my_onRequest($req, $resp)
{
echo "hello world";
}
$server->on('Request', 'my_onRequest');
class A
{
function test($req, $resp)
{
echo "hello world";
}
}
$object = new A();
$server->on('Request', array($object, 'test'));