twisted1919/yii2-options

It helps to manage your app options/settings

Installs: 2 282

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 4

Open Issues: 0

Type:yii2-extension

1.0.2 2020-04-08 19:32 UTC

This package is auto-updated.

Last update: 2024-05-09 04:27:42 UTC


README

Install via composer:

composer require twisted1919/yii2-options

Run the migration:

./yii migrate --migrationPath=@vendor/twisted1919/yii2-options/migrations

Add the component in your configuration file:

'components' => [  
    [...]  
    'options' => [  
        'class' => '\twisted1919\options\Options'  
    ],  
    [...]  
]

Api:

Please note that options() is added by twisted1919/yii2-shortcut-functions automatically.

SET
options()->set($key, $value);
GET
options()->get($key, $defaultValue = null);
REMOVE
options()->remove($key);