PHPackages                             solutosoft/yii-settings - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. solutosoft/yii-settings

ActiveYii-extension[Database &amp; ORM](/categories/database)

solutosoft/yii-settings
=======================

The Shared Database used by all tenants

2.1.0(12mo ago)11.9kBSD-3-ClausePHPCI passing

Since May 10Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/solutosoft/yii-settings)[ Packagist](https://packagist.org/packages/solutosoft/yii-settings)[ Docs](https://github.com/solutosoft/yii-settings)[ RSS](/packages/solutosoft-yii-settings/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Yii Settings Extension
======================

[](#yii-settings-extension)

This extension provides support for persistent settings for Yii2.

[![Build Status](https://github.com/solutosoft/yii-settings/actions/workflows/tests.yml/badge.svg)](https://github.com/solutosoft/yii-settings/actions)[![Total Downloads](https://camo.githubusercontent.com/acc12955704e6bf26c75481a72c487b161de067d685ca93b2b02c0a051ebb3b2/68747470733a2f2f706f7365722e707567782e6f72672f736f6c75746f736f66742f7969692d73657474696e67732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/solutosoft/yii-settings)[![Latest Stable Version](https://camo.githubusercontent.com/9a7120b4fac7c41e7e5730152c69a1761d1327cba6ca3ed5fd96bc67ae9887fe/68747470733a2f2f706f7365722e707567782e6f72672f736f6c75746f736f66742f7969692d73657474696e67732f762f737461626c652e706e67)](https://packagist.org/packages/solutosoft/yii-settings)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist solutosoft/yii-settings

```

or add

```
"solutosoft/yii-settings": "*"
```

Configuration
-------------

[](#configuration)

To use the Setting Component, you need to configure the components array in your application configuration:

```
'components' => [
    'settings' => [
        'class' => 'solutosoft\settings\Settings',
    ],
],
```

Usage
-----

[](#usage)

```
$settings = Yii::$app->settings;

$settings->set('key');

$settings->set('section.key');

// Checking existence of setting
$settings->exists('key');

// Removes a setting
$settings->remove('key');

// Removes all settings
$settings->removeAll();
```

Events
------

[](#events)

You can use `beforeExecute` event to store extra values and apply extra conditions on command execution

```
