A Symfony bundle for route templating
- Route templating
- Copy all routes defined in the imported resource with the specified prefix
 
RouteTemplatingBundle can be installed using Composer.
First, add the dependency to phpmentors/route-templating-bundle into your composer.json file as the following:
Stable version:
composer require phpmentors/route-templating-bundle "1.1.*"
Development version:
composer require phpmentors/route-templating-bundle "~1.2@dev"
Second, add PHPMentorsRouteTemplatingBundle into your bundles to register in AppKernel::registerBundles() as the following:
...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new PHPMentors\RouteTemplatingBundle\PHPMentorsRouteTemplatingBundle(),
        );
        ...app/config/routing.yml:
# ...
photos:
    resource: "@PhotoBundle/Resources/config/routing.yml"
    prefix:   /photos
admin_photos:
    resource: "@PhotoBundle/Resources/config/routing.yml" # Same resource as `photos`
    prefix:   /admin/photos
    copy_as: admin_If you find a bug or have a question, or want to request a feature, create an issue or pull request for it on Issues.
Copyright (c) 2016-2018 KUBO Atsuhiro, All rights reserved.