eschmar / doctrine-routing-bundle
Dynamic database routing for Symfony2.
Installs: 76
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.3
- doctrine/doctrine-bundle: ~1.2
- doctrine/orm: ~2.2,>=2.2.3
- symfony/symfony: ~2.4
This package is auto-updated.
Last update: 2024-11-11 20:16:16 UTC
README
With this bundle you can persist a subset of your routes inside a database using the provided entity Route
. These routes will be cached and only updated if you clear your routing cache. This way you can manage your routes from an interface without abandoning cacheing. The bundle provides both command line and service triggering of clearing your cache.
Installation
Composer (Packagist):
"require": { "eschmar/doctrine-routing-bundle": "dev-master" },
app/Appkernel.php:
new Eschmar\DoctrineRoutingBundle\EschmarDoctrineRoutingBundle(),
app/config/routing.yml:
eschmar_doctrine_routing: resource: "@EschmarDoctrineRoutingBundle/Resources/config/routing.yml" prefix: /
Finally you have to update your doctrine schema for creating the database table.
Usage
Store your routes inside the provided Route
and RouteConfig
entities. After updating your routes you have to invoke
php app/console cache:clear:routing prod
or inside a controller
$helper = $this->get('eschmar_doctrine_routing.helper'); $helper->clear('prod');
for clearing the cache.
License
MIT License