Easily store some loose values into files
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources/img
src
.craftplugin
.gitignore
CHANGELOG.md
LICENSE.md
README.md
composer.json

README.md

Valuestore plugin for Craft CMS 3.x

Easily store some loose values into files

Screenshot

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require superbig/craft3-valuestore
    
  3. 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