https://github.com/eschmar/doctrine-routing-bundle
Dynamic database routing for Symfony2.
https://github.com/eschmar/doctrine-routing-bundle
Last synced: about 2 months ago
JSON representation
Dynamic database routing for Symfony2.
- Host: GitHub
- URL: https://github.com/eschmar/doctrine-routing-bundle
- Owner: eschmar
- License: mit
- Created: 2014-01-03T13:08:08.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-04-09T22:13:33.000Z (over 10 years ago)
- Last Synced: 2025-08-15T08:42:16.368Z (3 months ago)
- Language: PHP
- Size: 292 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-symfony - doctrine-routing-bundle - Dynamic database routing. (Storage)
README
# DoctrineRoutingBundle
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):
```json
"require": {
"eschmar/doctrine-routing-bundle": "dev-master"
},
```
app/Appkernel.php:
```yaml
new Eschmar\DoctrineRoutingBundle\EschmarDoctrineRoutingBundle(),
```
app/config/routing.yml:
```yaml
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
php app/console cache:clear:routing prod
```
or inside a controller
```php
$helper = $this->get('eschmar_doctrine_routing.helper');
$helper->clear('prod');
```
for clearing the cache.
## License
MIT License