pendalf89 / yii2-settings
Yii2 settings component
Installs: 42
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 2
Open Issues: 1
Type:yii2-extension
This package is auto-updated.
Last update: 2024-11-28 08:37:11 UTC
README
Yii2 settings component
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist pendalf89/yii2-settings "*"
or add
"pendalf89/yii2-settings": "*"
to the require section of your composer.json
file.
Apply migration
yii migrate --migrationPath=vendor/pendalf89/yii2-settings/migrations
Configuration:
'components' => [ 'settings' => [ 'class' => 'pendalf89\settings\Settings', ], ],
Usage
$settings = Yii::$app->settings; $settings->set('sitemap.update_cache_freq', 21600); echo $settings->get('sitemap.update_cache_freq'); // 21600 // Sample with default value: echo $settings->get('sitemap.update_cache_freq', 21600); // 21600