Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrogehlen committed May 25, 2019
2 parents 0206129 + 6e46736 commit 8c6df71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Yii Settings Change Log
=======================

1.1.0 under development
1.0.2 under development
-----------------------

- Added `removeAll` method

1.0.1 May 10, 2019
------------------

- Initial version
- Initial version
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Settings Extension
===================
Yii Settings Extension
======================

This extension provides support for persistent settings for Yii2.

Expand Down Expand Up @@ -30,6 +30,7 @@ Configuration
-------------

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

```php
'components' => [
'settings' => [
Expand All @@ -40,6 +41,7 @@ To use the Setting Component, you need to configure the components array in your

Usage:
---------

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

Expand All @@ -55,13 +57,12 @@ $settings->remove('key');

// Removes all settings
$settings->remove();

```

Events
------

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

```php
<?php
Expand All @@ -80,7 +81,6 @@ $settings = Yii::$app->settings;
//INSERT (`key`,`value`, `user_id`) INTO `setting` VALUES ('website', 'http://example.org', 1)
$settings->set('website', 'http://example.org');


//SELECT `value` FROM `setting` WHER (`settings`.`key` = 'website' and `settings`.`user_id` = 1)
$settings->get('website', 'http://example.org');

Expand Down

0 comments on commit 8c6df71

Please sign in to comment.