Latest release: v0.4

Apitte/Presenter

Content

Installation

Simpliest way to register this extension is via Nette\DI\CompilerExtension.

composer require apitte/presenter
1

Configuration

application:
	mapping:
		...
		Apitte: Apitte\Presenter\*Presenter
1
2
3
4

Router

You should prepend ApiRoute to your router. Therefor you can reach your API at <projecc>/api.s

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;
	}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15