PHP code example of nabeelalihashmi / apilot-engine

1. Go to this page and download the library: Download nabeelalihashmi/apilot-engine 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/ */

    

nabeelalihashmi / apilot-engine example snippets



    $apilot = new Apilot($handlers_path, $cache_path, $optional_server_basepath);
    $apiot->on404(function() {
        ...
    });
    $apilot->takeoff();

cockpit/
    index.php -> /
    about.php -> /about
    contact.php -> contact
    ...


    function GET() {

    }

    function POST() {

    }

    function PUT() {

    }
    

    File: cockpit/users/:id/edit.php
    URI: /users/:id/edit

    function GET($id) {
        ...
    }
s
    File: cockpit/users/:id/:action.php
    URI: /users/:id/:action

    function GET($id, $action) {
        ...
    }


    File: cockpit/list/:page?.php
    URI: /list/:page?

    function GET($page = 1) {
        ...
    }


function GET() {

}

function before_GET() {
    return true;
}

function after_GET() {

}

$apilot->on404(function() {
    ...
});