psmb/registry

Letzte Aktivität 08 Dec 2022 3 5 21469
composer require psmb/registry

Global registry of things with an Eel helper

2.1.3

Version
2.1.3
Type
neos-package
Release Date
Dec 08, 2022 12:29
Source
git
Distribution
zip
Requires
  • neos/flow: ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0
MIT 1d8ab6705bc7a3fd5722cfa1712a2eda6194a334

Use with caution and only if you absolutely have to!

This package provides you with a registry service and an Eel helper to get and set values on it.

Installation

composer require psmb/registry

Usage

Example

root = T:Collection {
    @context.blah = ${Registry.set('acc', 0)}
    collection = ${[1,2,3]}
    itemName = 'item'
    itemRenderer = T:Value {
        @context.blah = ${Registry.set('acc', item + Registry.get('acc'))}
        value = ${Registry.get('acc')}
    }
}

The following methods are available:

  • set(key, value): Sets a value by key
  • get(key): Returns a value by key
  • getset(key, value): Atomically sets key to value and returns the old value stored at key.
  • increment(key): Increment a value by key
  • decrement(key): Derement a value by key

A key can consist of a single string or a path, separated with dots which addresses a value in a nested array.

The content of the readme is provided by Github
The same vendor provides 13 package(s).