library silex-routing-provider
Routing service provider for silex micro-framework using annotations
marlosoft/silex-routing-provider
Routing service provider for silex micro-framework using annotations
- Thursday, September 14, 2017
- by marlosoft
- Repository
- 0 Watchers
- 0 Stars
- 7 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
Silex Routing Service Provider
Routing service provider for silex micro-framework using annotations.
This uses sensio/framework-extra-bundle
and doctrine/common
libraries
to use annotation for routing just like in Symfony2 framework., (*1)
Installation
- Use composer
bash
composer require marlosoft/silex-routing-provider
Usage
-
Add Doctrine's annotation registry loader to autoload, (*2)
use Doctrine\Common\Annotations\AnnotationRegistry;
$autoload = require('/path/to/vendor/autoload.php');
AnnotationRegistry::registerLoader([$autoload, 'loadClass']);
-
Register the service provider to your application, (*3)
use Marlosoft\Silex\Provider\RoutingServiceProvider;
$app = new Application();
$app->register(new RoutingServiceProvider(), [
'routes.directories' => ['/path/to/controllers/directory/']
]);
Options
-
routes.directories
(required) is an array of directory paths where the annotations are evaluated
-
routes.cache
(optional) is the cache object that will be used to store the evaluated annotations.
This is recommended in production deployments. Cache objects that can use used are FilesystemCache
or ApcuCache
dev-master
9999999-dev
Routing service provider for silex micro-framework using annotations
Sources
Download
MIT
The Requires
The Development Requires
by
John Marlo Factorin
1.0.0
1.0.0.0
Routing service provider for silex micro-framework using annotations
Sources
Download
MIT
The Requires
The Development Requires
by
John Marlo Factorin