Skip to content

phpmentors-jp/route-templating-bundle

Repository files navigation

RouteTemplatingBundle

A Symfony bundle for route templating

Total Downloads Latest Stable Version Latest Unstable Version Build Status

Features

  • Route templating
    • Copy all routes defined in the imported resource with the specified prefix

Installation

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(),
        );
        ...

Configuration

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_

Support

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

Copyright (c) 2016-2018 KUBO Atsuhiro, All rights reserved.

License

The BSD 2-Clause License