PHP code example of craffft / api-client-bundle

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

    

craffft / api-client-bundle example snippets



// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Craffft\ApiClientBundle\CraffftApiClientBundle(),
        );

        // ...
    }

    // ...
}


// app/config/security.yml

security:
    // ...

    providers:
        craffft.api_client.security.user_provider:
            id: craffft.api_client.security.user_provider

    // ...

    firewalls:
        api:
            pattern: ^/api
            stateless: true
            simple_preauth:
                authenticator: craffft.api_client.security.api_key_authenticator
            provider: craffft.api_client.security.user_provider

    // ...