Skip to content

Full Symfony Router support (caching, yaml, xml, annotations) for Silex 2.x

Notifications You must be signed in to change notification settings

skalpa/silex-router-provider

Repository files navigation

Build Status Scrutinizer Code Quality Code Coverage

Symfony Router Service Provider for Silex 2.x / Pimple 3.x

ALPHA. First release in a few days.

Lets you to use the full Symfony Router class in your Silex/Pimple application.

Installation

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

Registration

$app->register(new \Skalpa\Silex\Symfony\Routing\RouterServiceProvider(), [
    'router.resource' => '/path/to/routing.yml',
    'router.cache_dir' => '/path/to/cache',
]);

Configuration parameters

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

Usage

About

Full Symfony Router support (caching, yaml, xml, annotations) for Silex 2.x

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages