PHP code example of targito / targito-api-bundle

1. Go to this page and download the library: Download targito/targito-api-bundle 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/ */

    

targito / targito-api-bundle example snippets




return [
    // ...
    Targito\Bundle\Api\TargitoApiBundle::class => ['all' => true],
];




use Targito\Api\TargitoApi;

class MyService
{
    public function __construct(TargitoApi $targitoApi)
    {
        $targitoApi->contacts()->addContact([
            //...
        ]);
        $targitoApi->transact()->sendEmail([
            //...
        ]);
    }
}




use Targito\Api\Endpoint\TargitoContactEndpoint;
use Targito\Api\Endpoint\TargitoTransactEndpoint;

class MyService
{
    public function __construct(TargitoContactEndpoint $contactEndpoint, TargitoTransactEndpoint $transactEndpoint)
    {
        $contactEndpoint->addContact([]);
        $transactEndpoint->sendEmail([]);
    }
}