superbig / craft3-valuestore
Easily store some loose values into files
Installs: 89
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:craft-plugin
pkg:composer/superbig/craft3-valuestore
Requires
- craftcms/cms: ^3.0.0-beta.23
- spatie/valuestore: ~1.2.1
This package is auto-updated.
Last update: 2022-07-14 19:37:11 UTC
README
Easily store some loose values into files
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later.
Installation
To install the plugin, follow these instructions.
- 
Open your terminal and go to your Craft project: cd /path/to/project
- 
Then tell Composer to load the plugin: composer require superbig/craft3-valuestore
- 
In the Control Panel, go to Settings → Plugins and click the “Install” button for Valuestore. 
Using Valuestore
{% set store = craft.valuestore.create('storeName.json') %}
{% do store.put('key', 'value') %}
{# Returns "value" #}
{{ store.get('key') }}
{# Returns true #}
{{ store.has('key') }}
{# Iterate over values #}
{% for key,value in store.all() %}{% endfor %}
{# Increment number - returns 1 #}
{{ store.increment('number') }}
See full overview of methods in the Valuestore readme
Credits
Add calendar icon by Ben Davis
Brought to you by Superbig
