Symphony CMS Extension for storing and retrieving key/value settings in a simple and clean way.

Clone URLhttps://github.com/pointybeard/settings.git

Add as a submodulegit submodule add https://github.com/pointybeard/settings.git extensions/settings --recursive




Settings Extension for Symphony CMS

A Symphony CMS Extension for storing and retrieving key/value settings in a simple and clean way.


This is an extension for Symphony CMS. Add it to your /extensions folder in your Symphony CMS installation, run composer update to install required packages and then enable it though the interface.


This extension requires PHP 7.3 or greater.

This extension depends on the following Composer libraries:

Run composer update on the extension/settings directory to install these.


Here is an example of how to use this extension in your code.

Saving Settings

There are 2 ways to save settings. By browsing to "System" > "Settings" in the admin and adding/editing/deleting settings or in code by using the Settings model.

```php <?php


use pointybeardSymphonyExtensionsSettingsModels;

// Saving a new setting (new ModelsSettings) ->name("mysetting") ->value("one two three") ->group("myapp") ->save() ; ```

Retriving Settings

The main use of this extension is going to be to recall settings when needed. There are 2 important methods to know about:

ModelsSetting::fetchByGroup() and ModelsSetting::loadFromNameFilterByGroup()

```php <?php


use pointybeardSymphonyExtensionsSettingsModels;

// Retrieve a single setting using both it's name and group $setting = ModelsSetting::loadFromNameFilterByGroup("mysetting", "myapp");

// Retrieve an entire group of settings $setting = ModelsSetting::fetchByGroup("myapp"); ```

The fetchByGroup() method returns an instance of SettingsSettingsResultIterator which includes an additional method you can use to find specific settings in a group of results.

```php <?php


use pointybeardSymphonyExtensionsSettingsModels;

// Find a specific setting from a group of settings and return its value $value = ModelsSetting::fetchByGroup("myapp")->find("mysetting"); ```


If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.


We encourage you to contribute to this project. Please check out the Contributing documentation for guidelines about how to get involved.


"Settings Extension for Symphony CMS" is released under the MIT License.

Version history

Works up to Symphony 2.7.10