marcinjozwikowski/settingsindbbundle
最新稳定版本:0.1.4
Composer 安装命令:
composer require marcinjozwikowski/settingsindbbundle
包简介
A Symfony2 bundle that allows an easy key-value storage in DB
关键字:
README 文档
README
A Symfony2 bundle that allows an easy key-value storage in DB
Installation
- Add as composer dependency:
composer require marcin_jozwikowski/settings_in_db_bundle
- Add in application kernel:
class AppKernel extends Kernel { public function registerBundles() { //... $bundles[] = new \MarcinJozwikowski\SettingsInDBBundle\SettingsInDBBundle(); return $bundles; } }
- Update database schema:
php app/console doctrine:schema:update --force
##Usage
- Access DB stored values through service:
//in controller $val = $this->get('settings_in_db_service')->read('key', 'defaultValue');
##Configuration
Default configuration:
settings_in_db: allow_inserts: true return_null_on_not_found: false read_all_entries_at_first_use: true
- allow_inserts - if set to true, persists a new key-value pair if none is found
- return_null_on_not_found - if nothing found and allow_inserts = false, returns null instead of throwing an exception
- read_all_entries_at_first_use - if set to true loads all records at first use and searches in internal array insted of querying
统计信息
- 总下载量: 45
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-01