1. Go to this page and download the library: Download apirelio/nette 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/ */
apirelio / nette example snippets
use Apirelio\Nette\ApirelioManager;
final class InvoiceService
{
public function __construct(private ApirelioManager $apirelio) {}
public function create(): void
{
$this->apirelio->addMetadata(['region' => 'eu-central']);
$this->apirelio->setErrorCode('VALIDATION_FAILED');
}
}
use Nette\Application\Request;
use Apirelio\Nette\Contracts\CustomerResolver;
use Apirelio\Nette\Data\ApirelioCustomer;
final class CurrentCustomerResolver implements CustomerResolver
{
public function resolve(Request $request): ?ApirelioCustomer
{
return new ApirelioCustomer('customer_42', 'Acme Europe', 'growth');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.