Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

服务端调用出错Argument func must be callable. #29

Closed
hinet opened this issue Oct 26, 2016 · 1 comment
Closed

服务端调用出错Argument func must be callable. #29

hinet opened this issue Oct 26, 2016 · 1 comment

Comments

@hinet
Copy link

hinet commented Oct 26, 2016

在laravel中服务端调用出错提示:
Argument func must be callable.

`namespace App\Http\Controllers;
use Hprose\Http\Server;
use Illuminate\Http\Request;

class TestController extends Controller
{
public function index(){
$server = new Server();
$server->addFunction('hello',$this);
$server->start();
}
public function hello(){
return "Hello";
}
}`

@hinet
Copy link
Author

hinet commented Oct 26, 2016

因调用的是方法,所以应该使用addMethod来添加方法:

$server->addMethod('hello',$this);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant