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.
// From ServiceManager
$this->getServiceLocator()->get('HtSettingsManager')->save($settingsEntity, 'settings_namespace');
// From Controller
$this->settings()->save($settingsEntity, 'settings_namespace');
// 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');
- 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
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.
HtSettingsModule is inspired by SyliusSettingsBundle.