PHP code example of sahil-gulati / apibase

1. Go to this page and download the library: Download sahil-gulati/apibase 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/ */

    

sahil-gulati / apibase example snippets





ster routes
APIBase\URL\Router::registerRoutes("/api/v1", array(
    array(
        METHOD => "GET",
        ROUTE => "/payments",
        HANDLER => "helloWorld"
    )
));

# Process request
APIBase\URL\Invoker::processRequest();

function helloWorld(){
    echo json_encode(array("message" => "Hello from sahil!"));
}