PHP code example of gemvc / library

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

    

gemvc / library example snippets


// API — allowlist + type-check GET params
$this->request->findable(['name' => 'string', 'email' => 'email']);   // find_like=
$this->request->filterable(['role' => 'string']);                    // filter_by=
$this->request->sortable(['id', 'name', 'created_at']);              // sort_by / sort_by_asc
return $this->callController(new UserController($this->request))->list();

// Controller — one call: filter + LIKE + sort + page + columns + total count + APM
return $this->createList(
    $this->createModel(new UserModel()),
    'id,name,email,role,created_at'
);

use Gemvc\Http\ServiceCall;

$body = ServiceCall::to('auth')
    ->post('/api/Auth/oauthLogin', $payload)
    ->withInternalTrust()   // or ->withoutInternalTrust() (->fireAndForget();
bash
composer in/gemvc init --swoole   # or --apache | --nginx | --frankenphp
# optional codegen + db introspection:
composer