PHP code example of fengdangxing / yii2-yar-rpc

1. Go to this page and download the library: Download fengdangxing/yii2-yar-rpc 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/ */

    

fengdangxing / yii2-yar-rpc example snippets


#注册服务-单个
Rpc::setService($this->request, $this->response);
#客户端调用服务里的method
$client = Rpc::getService(\backend\modules\v1\service\Task::class, 'http://www.t.com/wms_v1/rpc/server');
$back = $client->add_test(1, 2);

#并行