hrevert / ht-settings-module
Flexible Settings module for Zend Framework 2 applications
0.1.0
2014-06-28 14:26 UTC
Requires
- php: >=5.4
- zendframework/zend-servicemanager: ~2.2
- zendframework/zend-stdlib: ~2.2
Requires (Dev)
- league/flysystem: 0.4.*
- phine/test: 1.0.*
- zendframework/zend-cache: ~2.2
- zendframework/zend-config: ~2.2
- zendframework/zend-json: ~2.2
- zendframework/zend-modulemanager: ~2.2
- zendframework/zend-mvc: ~2.2
- zendframework/zend-view: ~2.2
- zf-commons/zfc-base: 0.1.*
Suggests
- league/flysystem: If you want to use xml/json storage adapters provided by this module
- zendframework/zend-cache: if you want to cache settings
- zendframework/zend-config: If you want to use xml storage adapter
- zendframework/zend-json: If you want to use json storage adapter
- zendframework/zend-modulemanager: To use it as a Zend Framework 2 module
- zendframework/zend-mvc: To use with Zend Framework 2 MVC
- zendframework/zend-view: To use some view helpers
- zf-commons/zfc-base: if you want to use Zend\Db for settings persistence
This package is auto-updated.
Last update: 2024-12-13 03:53:16 UTC
README
HtSettingsModule is a module for adding settings support to your Zend Framework 2 application. This module does not provide any GUI for settings. It just provides a way for easy persistence of application settings.
Getting started guide
Storing settings
// From ServiceManager $this->getServiceLocator()->get('HtSettingsManager')->save($settingsEntity, 'settings_namespace'); // From Controller $this->settings()->save($settingsEntity, 'settings_namespace');
Retrieving settings
// From Controller $settingsEntity = $this->settings('settings_namespace'); // From view templates $settingsEntity = $this->settings('settings_namespace'); // From ServiceLocatorAware classes $settingsEntity = $this->getServiceLocator()->get('HtSettingsManager')->getSettings('settings_namespace');
Installation
- Add
"hrevert/ht-settings-module": "0.1.*"
to composer.json and runphp composer.phar update
- Register
HtSettingsModule
as module inconfig/application.config.php
- Copy the file located in
vendor/hrevert/ht-settings-module/config/ht-settings-module.global.php
toconfig/autoload
and change the values as you wish - Read this for setting up a storage adapter
Docs
The official documentation of HtSettingsModule is available in the /docs folder. Please read the quickstart guide to quickly get your hands dirty with this module.
Acknowledgements
HtSettingsModule is inspired by SyliusSettingsBundle.