gupalo / config-bundle
配置包
1.4.4
2024-05-17 13:17 UTC
Requires
- php: >=7.4
- ext-json: *
- doctrine/orm: ^2.7|^3.0
- gupalo/browser-notifier: ^1.0
- gupalo/dateutils: ^1.4
- symfony/cache: ^6.4|^7.0
- symfony/form: ^6.4|^7.0
- symfony/notifier: ^6.4|^7.0
- symfony/translation: ^6.4|^7.0
- symfony/yaml: ^6.4|^7.0
- twig/twig: ^3.3
Requires (Dev)
- doctrine/doctrine-bundle: ^2.5
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
- symfony/security-guard: ^5.4|^6.0
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