sergiors / routing-service-provider
Import your routes from YAML, PHP files or Directory.
Installs: 42 361
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 5
Forks: 0
Open Issues: 0
Requires
- silex/silex: ^2
- symfony/config: ^2.8|^3.0
- symfony/routing: ^2.8|^3.0
Requires (Dev)
- pdepend/pdepend: ~2.0
- phing/phing: ~2.10
- phploc/phploc: ~2.1
- phpmd/phpmd: ~2.2
- phpunit/phpunit: ~4.8
- sebastian/phpcpd: ~2.0
- squizlabs/php_codesniffer: ~2.1
- symfony/dependency-injection: ^2.8|^3.0
- symfony/yaml: ^2.8|^3.0
Suggests
- symfony/dependency-injection
- symfony/yaml: For using the YAML loader
This package is not auto-updated.
Last update: 2024-12-17 05:32:47 UTC
README
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