Skip to content

perfectio/yii2-json-rpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonRpc Server and Client for Yii2

##Usage Server

  1. Install with Composer
"require": {
    "nizsheanez/yii2-json-rpc": "1.*",
},

php composer.phar update
  1. Add action to controller
public function actions()
{
    return array(
        'index' => array(
            'class' => '\nizsheanez\JsonRpc\Action',
        ),
    );
}

public function sum($a, $b) {
	return $a + $b;
}
  1. All methods of controller now available as JsonRpc methods, for example see method sum:

##Usage Client

$client = new \nizsheanez\JsonRpc\Client('http://url/of/webservice');

$response = $client->sum(2, 3);
echo $response;
  1. Enjoy!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%