{"id":15282390,"url":"https://github.com/solutosoft/yii-settings","last_synced_at":"2026-01-04T23:05:42.008Z","repository":{"id":57055413,"uuid":"184089213","full_name":"solutosoft/yii-settings","owner":"solutosoft","description":"Yii Settings Extension","archived":false,"fork":false,"pushed_at":"2020-08-27T10:11:35.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T02:52:49.726Z","etag":null,"topics":["database","settings","yii2","yii2-extension"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solutosoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-29T14:43:48.000Z","updated_at":"2022-04-20T20:09:07.000Z","dependencies_parsed_at":"2022-08-24T14:00:22.205Z","dependency_job_id":null,"html_url":"https://github.com/solutosoft/yii-settings","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutosoft%2Fyii-settings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutosoft%2Fyii-settings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutosoft%2Fyii-settings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solutosoft%2Fyii-settings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solutosoft","download_url":"https://codeload.github.com/solutosoft/yii-settings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245136354,"owners_count":20566586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","settings","yii2","yii2-extension"],"created_at":"2024-09-30T14:25:33.603Z","updated_at":"2026-01-04T23:05:42.003Z","avatar_url":"https://github.com/solutosoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yii Settings Extension\n======================\n\nThis extension provides support for persistent settings for Yii2.\n\n[![Build Status](https://github.com/solutosoft/yii-settings/actions/workflows/tests.yml/badge.svg)](https://github.com/solutosoft/yii-settings/actions)\n[![Total Downloads](https://poser.pugx.org/solutosoft/yii-settings/downloads.png)](https://packagist.org/packages/solutosoft/yii-settings)\n[![Latest Stable Version](https://poser.pugx.org/solutosoft/yii-settings/v/stable.png)](https://packagist.org/packages/solutosoft/yii-settings)\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require --prefer-dist solutosoft/yii-settings\n```\n\nor add\n\n```json\n\"solutosoft/yii-settings\": \"*\"\n```\n\nConfiguration\n-------------\n\nTo use the Setting Component, you need to configure the components array in your application configuration:\n\n```php\n'components' =\u003e [\n    'settings' =\u003e [\n        'class' =\u003e 'solutosoft\\settings\\Settings',\n    ],\n],\n```\n\nUsage\n-----\n\n```php\n$settings = Yii::$app-\u003esettings;\n\n$settings-\u003eset('key');\n\n$settings-\u003eset('section.key');\n\n// Checking existence of setting\n$settings-\u003eexists('key');\n\n// Removes a setting\n$settings-\u003eremove('key');\n\n// Removes all settings\n$settings-\u003eremoveAll();\n```\n\nEvents\n------\n\nYou can use `beforeExecute` event to store extra values and apply extra conditions on command execution\n\n```php\n\u003c?php\n\n'components' =\u003e [\n    'settings' =\u003e [\n        'class' =\u003e 'solutosoft\\settings\\Settings',\n        'on beforeExecute' =\u003e function ($event) {\n            $event-\u003edata = ['user_id' =\u003e Yii::$app-\u003euser-\u003eid];\n        }\n    ],\n],\n\n$settings = Yii::$app-\u003esettings;\n\n//INSERT (`key`,`value`, `user_id`) INTO `setting` VALUES ('website', 'http://example.org', 1)\n$settings-\u003eset('website', 'http://example.org');\n\n//SELECT `value` FROM `setting` WHER (`settings`.`key` = 'website' and `settings`.`user_id` = 1)\n$settings-\u003eget('website', 'http://example.org');\n\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolutosoft%2Fyii-settings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolutosoft%2Fyii-settings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolutosoft%2Fyii-settings/lists"}