sergiors/routing-service-provider

Import your routes from YAML, PHP files or Directory.

dev-master 2017-05-31 15:01 UTC

This package is not auto-updated.

Last update: 2024-04-09 02:05:19 UTC


README

Build Status

Import your routes from yaml, php files or directory.

Install

composer require sergiors/routing-service-provider "dev-master"

How to user

Your yaml file

index_controller:
    prefix: /
    defaults: {_controller: 'Acme\Acme\Controller\IndexController::indexAction'}

In your php file

use Sergiors\Silex\RoutingServiceProvider;

$app->register(new RoutingServiceProvider(), [
    'routing.resource' => __DIR__.'/routing.yml'
]);

Remeber, you need install symfony/yaml to use YAML.

To use %root_dir% in your yaml files, you need to install symfony/dependency-injection and set $app['routing.replacements'] = ['root_dir' => '']

License

MIT