in package

Allows to resolve variables and define if they are required or optional with a default.

It also allows to resolve variables by closure(VariableResolver $r) instead of value.

Known variables (= [default] | * (required)):

Consumer data

consumer.privacyPolicyUrl            = * string
consumer.legalNoticeUrl              = * string
consumer.provider                    = * string       = * string       = * string        = * string                   = * string        = * string                = * string       = * string     = * string
template.fbPixel.scriptLocale        = * Script locale used for Facebook pixel SDK js

Created templates

Array of existing / created blocker and services within the consumer environment. You do not need to fill all properties of the template object, but consumerData['id'] and identifier should be filled to make sure that the internal middlewares are working as expected.

created.{TemplateClass::class}       = * TemplateClass[]{TemplateClass::class}    = * TemplateClass[]
tcfVendors.created = Array<{ vendorId: number; vendorConfigurationId: number; }>

What is the difference between created. and In a consumer environment like e.g. WordPress and WPML as plugin installed, created. should only return the elements for the current language (current context). The should return all entries across all languages.


blocker.consumer   = * Service cloud consumer for blocker templates
service.consumer   = * Service cloud consumer for service templates
tier               = * "free" | "pro"
manager            = * "none" | "googleTagManager" | "googleTagManagerWithGcm" | "matomoTagManager"
serviceScan        = Record<string (identifier), { foundCount: number; foundOnSitesCount: number; lastScanned: string; }>;
serviceScanIgnored = string[]
isTcfActive        = boolean

One-of mechanism

Closure which needs to return boolean when the passed statement is fulfilled (e.g. checks if a setting or plugin is active). When you return e.g. a string it will considered as fulfilled and replace the statement for the $fulfilledStatement variable.

oneOf      = * (statement: string, template?: AbstractTemplate) => false | true | mixed


i18n.disabled                                                              = "Disabled"
i18n.ContentTypeButtonTextMiddleware.loadContent                           = "Load content"
i18n.ContentTypeButtonTextMiddleware.loadMap                               = "Load map"
i18n.ContentTypeButtonTextMiddleware.loadForm                              = "Load form"
i18n.ExistsMiddleware.alreadyCreated                                       = "Already created"
i18n.ExistsMiddleware.blockerAlreadyCreatedTooltip                         = "You have already created a Content Blocker with this template."
i18n.ExistsMiddleware.serviceAlreadyCreatedTooltip                         = "You have already created a Service (Cookie) with this template."
i18n.ManagerMiddleware.tooltip                                             = "This service template is optimized to work with %s."
i18n.ManagerMiddleware.disabledTooltip                                     = "Please activate %s in settings to use this template."
i18n.ServiceAvailableBlockerTemplatesMiddleware.tooltip                    = "A suitable content blocker for this service can be created automatically."                                       = "Essential"                                      = "Functional"                                      = "Statistics"                                       = "Marketing"
i18n.OneOfMiddleware.disabledTooltip                                       = "This template is currently disabled because a dependency component is not installed or the desired function is not active."
i18n.TcfMiddleware.disabled                                                = "TCF required"
i18n.TcfMiddleware.disabledTooltip                                         = "This template requires the integration of TCF, as the provider of this template uses this standard. Please activate this in the settings to be able to block this service."

Table of Contents


$consumer  : mixed
$data  : array<string|int, mixed>
Registered variable data.


__construct()  : mixed
add()  : mixed
Add and register a variable with a given value.
getConsumer()  : mixed
resolveDefault()  : mixed
Resolve a variable by key with a default value.
resolveOneOf()  : mixed
Check an array of statements if one of them resolves truly with the required variable `oneOf`.
resolveRequired()  : mixed
Resolve a variable by key and require it.



Registered variable data.

private array<string|int, mixed> $data = []



Add and register a variable with a given value.

public add(string $key, mixed $value) : mixed
$key : string
$value : mixed

Can be also a closure which gets called with the following arguments: VariableResolver $resolver



public getConsumer() : mixed


Resolve a variable by key with a default value.

public resolveDefault(string $key[, mixed $default = null ]) : mixed
$key : string
$default : mixed = null


Check an array of statements if one of them resolves truly with the required variable `oneOf`.

public resolveOneOf(array<string|int, string> $statements, AbstractTemplate $template[, string &$fulfilledStatement = null ]) : mixed
$statements : array<string|int, string>
$template : AbstractTemplate
$fulfilledStatement : string = null

Automatically gets filled with the first fulfilled statement


Resolve a variable by key and require it.

public resolveRequired(string $key) : mixed
$key : string

On this page

Search results