zenify / modular-routing
Nette extension for modular routing
Installs: 10 504
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.5
- nette/application: ~2.3
- nette/di: ~2.3
- tracy/tracy: ~2.3
Requires (Dev)
- nette/bootstrap: ~2.3
- nette/robot-loader: ~2.3
This package is auto-updated.
Last update: 2022-01-27 10:58:29 UTC
README
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.