1. Go to this page and download the library: Download pradosoft/prado-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/ */
pradosoft / prado-rpc example snippets
namespace Application\Api;
use Prado\Web\Services\TRpcApiProvider;
class CustomersApi extends TRpcApiProvider
{
public function registerMethods(): array
{
return [
'getCustomer' => ['method' => [$this, 'getCustomer']],
'listCustomers' => ['method' => [$this, 'listCustomers']],
];
}
public function getCustomer(int $id): array { /* ... */ }
public function listCustomers(string $status = 'active'): array { /* ... */ }
}