gupalo/config-bundle

配置包

安装次数: 8,746

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:symfony-bundle

1.4.4 2024-05-17 13:17 UTC

README

安装

Composer

composer req gupalo/config-bundle

检查配置包是否已添加到 config/bundles.php

Gupalo\ConfigBundle\ConfigBundle::class => ['all' => true],

添加路由 - 创建 config/routes/config.yaml

config:
    resource: "@ConfigBundle/Resources/config/routing/routing.yaml"

如有需要,在 translations/messages.en.yaml 中覆盖翻译(参见 Resources/translations 了解可能的值)。

在数据库中创建 config

php bin/console make:migration
php bin/console doctrine:migrations:migrate -n

将可能的值和默认值添加到 service.yaml

parameters:
    ...
    config.defaults:
        SOME_PARAM: 0
        OTHER_PARAM: '-2 days'

用法

在浏览器中访问 /config