PHP code example of basilicom / rpc-gateway-symfony

1. Go to this page and download the library: Download basilicom/rpc-gateway-symfony 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/ */

    

basilicom / rpc-gateway-symfony example snippets


    $rpc = new \RpcGateway\Gateway();
    $rpc->setServiceClassNamespace('\Website\Rpc\Custom\\')



namespace AppBundle\Controller;

use Symfony\Component\HttpFoundation\Request;

class RpcController extends AbstractController
{

    public function defaultAction(Request $request)
    {
        $gateway = new \RpcGateway\Gateway($request);
        $gateway->setServiceClassNamespace('\AppBundle\Rpc\\');
        return $gateway->dispatch();
    }
}