phpmentors/route-templating-bundle

Symfony 路由模板化组件

v1.1.0 2018-10-02 07:53 UTC

This package is auto-updated.

Last update: 2024-08-29 05:03:34 UTC


README

Symfony 路由模板化组件

Total Downloads Latest Stable Version Latest Unstable Version Build Status

特性

  • 路由模板化
    • 将导入资源中定义的所有路由使用指定的前缀复制

安装

可以使用 Composer 安装 RouteTemplatingBundle。

首先,将依赖项 phpmentors/route-templating-bundle 添加到您的 composer.json 文件中,如下所示

稳定版本

composer require phpmentors/route-templating-bundle "1.1.*"

开发版本

composer require phpmentors/route-templating-bundle "~1.2@dev"

其次,将 PHPMentorsRouteTemplatingBundle 添加到您的组件中,并在 AppKernel::registerBundles() 中进行注册,如下所示

...
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_

支持

如果您发现错误或有问题,或想要请求功能,请在其 问题 页面上创建问题或拉取请求。

版权

版权所有 (c) 2016-2018 KUBO Atsuhiro,保留所有权利。

许可证

BSD 2-Clause 许可证