PHP code example of phphleb / api-multitool

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

    

phphleb / api-multitool example snippets



// File /app/Controllers/Api/BaseApiActions.php

namespace App\Controllers\Api;

use Hleb\Base\Controller;
use Phphleb\ApiMultitool\BaseApiTrait;

class BaseApiActions extends Controller
{
    // Adding a set of traits for the API.
    use BaseApiTrait;

    function __construct(array $config = [])
    {
        parent::__construct($config);

        // Passing the debug mode value to the API constructor.
        $this->setApiBoxDebug($this->container->settings()->isDebug());
    }
}