lp-digital / configuration-bundle
此包已被废弃,不再维护。未建议替换包。
每个站点的有用配置功能
v1.0.1
2017-06-07 09:18 UTC
Requires
- php: >=5.5
- backbee/backbee-php: 1.*
- backbee/utils: ~2.0
- doctrine/orm: ~2.4.0
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- mikey179/vfsstream: ~1.4.0
- phpunit/phpunit: 4.4.2
- symfony/yaml: ~2.7.0
This package is not auto-updated.
Last update: 2021-04-27 09:01:37 UTC
README
ConfigurationBundle 提供每个站点的有用配置功能。此包支持多站点实例。
安装
编辑您的 BackBee 项目的 composer.json
文件。
在 require
部分
# composer.json ... "require": { ... "lp-digital/configuration-bundle": "dev-master" }, ...
保存并关闭文件。
在项目中运行 composer update。
激活
编辑您的 BackBee 项目的 repository/Config/bundles.yml
文件。
在文件末尾添加以下行
# bundles configuration - repository/Config/bundles.yml ... conf: LpDigital\Bundle\ConfigurationBundle\Configuration
保存并关闭文件。
然后运行更新数据库的命令
./backbee bundle:update conf --force
根据您的配置,可能需要清除缓存。
配置
基本上,一个配置部分是一组具有与 BackBee 参数相同语法的元素集合,请参阅 参数参考
mysection: title: My section tite desc: My section description elements: myelement: type: text label: My element label value: "Sample value"
然后,此配置值将通过 CoonfigHelper 在模板中可用
<div> {{ this.ConfigHelper('mysection:myelement') }} {# echo Sample value #} </div>
然后,这些部分和元素将可用于从管理工具栏的包面板中进行编辑。部分数量和部分中元素的数量没有限制。
要在您的 BackBee 项目中添加一些配置值,创建并编辑文件:/repository/Config/bundle/conf/sections.yml
例如,以下显示所有可用的元素类型
#/repository/Config/bundle/conf/sections.yml sample: title: Fake Section desc: Fake section configuration elements: text: type: text label: Example for text value value: "" password: type: password label: Example for password value value: "" datetimepicker: type: datetimepicker label: Example for datetimepicker value value: 0 textarea: type: textarea label: Example for textarea value value: "" checkbox: type: checkbox label: Example for checkbox value options: {'fake1': 'Fake value 1', 'fake2': 'Fake value 2'} value: [] inline: true radio: type: radio label: Example for radio value options: {'fake1': 'Fake value 1', 'fake2': 'Fake value 2'} value: [] inline: true select: type: select label: Example for select value options: {'fake1': 'Fake value 1', 'fake2': 'Fake value 2'} value: [] nodeSelector: type: nodeSelector label: Example for nodeSelector value value: [] mediaSelector: type: mediaSelector label: Example for mediaSelector value value: [] linkSelector: type: linkSelector label: Example for linkSelector value value: []
保存并关闭文件,可选地清除缓存并享受...
本项目由 Lp digital 支持
主要开发者 : @cedric-b
在 GPL3 许可证下发布