ALPHA. First release in a few days.
Lets you to use the full Symfony Router class in your Silex/Pimple application.
Install the service provider using composer:
composer require skalpa/silex-router-provider
If you want to configure your routes using annotations, you'll also need the SensioFrameworkExtraBundle and a Doctrine annotations reader (see below):
composer require sensio/framework-extra-bundle
$app->register(new \Skalpa\Silex\Symfony\Routing\RouterServiceProvider(), [
'router.resource' => '/path/to/routing.yml',
'router.cache_dir' => '/path/to/cache',
]);
Parameter | Type | Description |
---|---|---|
router.debug |
bool |
Whether to enable the Router class debug mode |
router.resource |
string |string[] |
Where to load the router configuration from |
router.resource_type |
string |
Type of the resource (optional, needs to be set to annotation to import annotations from a PHP file) |
router.cache_dir |
string |
Where the request matcher and URL generator should be dumped |
router.file_locator.paths |
string[] |
List of folders passed to the file locator |
router.options |
array |
Additional options passed to the Router |
router.loaders |
string[] |
List of resource loaders that should be registered |