zenify/modular-routing

This package is abandoned and no longer maintained. The author suggests using the contributte/application package instead.

Nette extension for modular routing

0.1.2 2019-01-08 07:21 UTC

This package is not auto-updated.

Last update: 2019-08-12 15:18:12 UTC


README

Build Status Quality Score Code Coverage Downloads this Month Latest stable

Install

Via Composer:

$ composer require zenify/modular-routing

Register the extension in config.neon:

extensions:
	- Zenify\ModularRouting\DI\ModularRoutingExtension

Usage

Create class implementing Zenify\ModularRouting\Routing\RouterFactoryInterface:

namespace App\Modules\SomeModule\Routing;

use Nette\Application\Routers\Route;
use Nette\Application\Routers\RouteList;
use Zenify\ModularRouting\Routing\RouterFactoryInterface;


class SomeModuleRouterFactory implements RouterFactoryInterface
{
	
	/**
	 * {@inheritdoc}
	 */
	public function create()
	{
		$router = new RouteList('SomeModule');
		$router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
		return $router;
	}
	
}

Register it to config.neon:

services:
	- App\Modules\SomeModule\Routing\SomeModuleRouterFactory

That's it!

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.