PHP code example of czahoo / api-framework

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

    

czahoo / api-framework example snippets


// Register vendor autoloader
_start();
Framework::detectContext($_GET['API_TYPE']);
Framework::translateUrl($_GET['URL']);
Framework::run();

$FRAMEWORK_ROUTING = array(
    Framework::API_TYPE_EXTERNAL => array(
        Framework::DEFAULT_CONTROLLER_ROUTE_NAME => 'Api\App\Basic\Controller\BasicControllerName',
        'custom_route' => 'Api\App\Path\To\Your\Controller',
    ),
    Framework::API_TYPE_INTERNAL => array(
        Framework::DEFAULT_CONTROLLER_ROUTE_NAME => 'Api\App\Basic\Controller\BasicControllerName',
    ),
);