Skip to content

dantleech/RoutingAutoBundle

 
 

Repository files navigation

[WIP] Symfony CMF Routing Auto Route Bundle Build Status

This bundle is a WIP which automatically creates and manages routes for configured persisted document classes.

See the official documentation

Example configuration

The following is the current functional test configuration:

symfony_cmf_routing_auto:

    auto_route_mapping:

        ## 
        # e.g. /cms/auto-route/blog/my-blogs-title
        Symfony\Cmf\Bundle\RoutingAutoBundle\Tests\Functional\app\Document\Blog:

            # generate or use path components leading up to the final part of the path
            content_path:
                base:
                    provider: 
                        name: specified
                        path: /test/auto-route/blog
                    exists_action:
                        strategy: use
                    not_exists_action:
                        strategy: create
                        patcher: generic

            content_name:
                provider: 
                    name: from_object_method
                    method: getTitle
                exists_action: 
                    strategy: auto_increment
                    pattern: -%d
                not_exists_action: 
                    strategy: create

Restrictions:

  • Only documents stored with PHPCR-ODM are supported.
  • You must have the RoutingExtraBundle installed.

Installation

Add a requirement for symfony-cmf/routing-auto-bundle to your composer.json and instantiate the bundle in your AppKernel.php

new Symfony\Cmf\Bundle\RoutingAutoBundle\SymfonyCmfRoutingAutoBundle()

Running the tests

To initialize the test environment run the initialization script (you only need to do this once):

./Tests/Functional/init_travis.sh

Then run all the tests with:

phpunit -c phpunit.xml.dist

About

Adding automatic route generating on top of the symfony cmf routing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.8%
  • Shell 0.2%