PHP code example of colibri-php / colibri

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

    

colibri-php / colibri example snippets


// routes/api/posts/index.php
return [
    'GET' => fn($request, $params) => DB::select('posts', '*'),
    'POST' => fn($request, $params) => DB::insert('posts', $request->body()),
];

routes/web/about.latte       → GET /about
routes/web/blog/[slug].latte → GET /blog/my-post
routes/api/users/index.php   → GET /api/users
routes/api/users/[id].php    → GET /api/users/42