Download the PHP package unlimix/yii2-json-rpc without Composer
On this page you can find all versions of the php package unlimix/yii2-json-rpc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package yii2-json-rpc
JsonRpc Server and Client for Yii2
Usage Server
1) Install with Composer
"require": {
"unlimix/yii2-json-rpc": "dev-master",
},
php composer.phar update
2) Add action to controller
public function actions()
{
return array(
'index' => array(
'class' => '\unlimix\jsonRpc\Action',
),
);
}
public function sum($a, $b) {
return $a + $b;
}
3) TEST:
function sendRPC(){
$.ajax({
url: 'YOUR URL',
data: JSON.stringify({
"jsonrpc": "2.0",
"id": '',
"method": "sum",
"params": [1, 2]
}),
type: 'POST',
dataType: 'JSON',
contentType: 'application/json-rpc',
complete: function (xhr, status) {
console.log(xhr);
console.log(status);
}
});
}
4) Enjoy!
All versions of yii2-json-rpc with dependencies
PHP Build Version
Package Version
The package unlimix/yii2-json-rpc contains the following files
Loading the files please wait ....