Website 🚀 contributte.org | Contact 👨🏻💻 f3l1x.io | Twitter 🐦 @contributte
| This project is no longer being maintained. |
|---|
| Composer | apitte/presenter |
|---|---|
| Version | |
| PHP | |
| License |
This package integrated Apitte into nette/routing with a presenter.
Note: Usage of this package was not recommended as it required unnecessary conversion of nette request into psr-7 request. It also added headers from nette response configuration which were usually meant for UI, not an API.
The presenter was incompatible with middlewares.
To install the latest version of apitte/presenter use Composer.
composer require apitte/presenter
First of all, setup core package.
Install apitte/presenter
composer require apitte/presenter
Configure presenter mapping
application: mapping: Apitte: Apitte\Presenter\*Presenter
Prepend ApiRoute to your router. Therefore you can reach your API at <project>/api.
namespace App\Router; use Apitte\Presenter\ApiRoute; use Nette\Application\IRouter; use Nette\StaticClass; class RouterFactory { use StaticClass; public static function createRouter(): IRouter { $router = new RouteList; $router[] = new ApiRoute('api'); $router[] = new Route('<presenter>/<action>', 'Homepage:default'); return $router; } }
In index.php drop Apitte\Core\Application\IApplication and keep Nette\Application\Application only.
| State | Version | Branch | Nette | PHP |
|---|---|---|---|---|
| stable | ^0.8 |
master |
3.0+ | >=7.3 |
| stable | ^0.5 |
master |
2.4 | >=7.1 |
This package was maintained by these authors.
Consider to support contributte development team. Also thank you for using this package.