TwigItemDataField

Created for the ShopBuilder text widget.

Namespace

Ceres\Extensions

Extends
Implements
Properties
Type Name Description

TwigFactory

$twig

The factory to render TWIG.

array

$itemData

This array acts as a stack (LIFO). The last element is used for data field fetches.

Methods
public __construct($twig)

TwigItemDataField constructor.

Parameters

Type

Name

Description

TwigFactory

$twig

The factory to render TWIG.

public getName():string

Return the name of the extension.

public getFunctions():array

Return a list of functions to add.

public getFilters():array

Return a list of filters to add.

public setItemDataBase($itemData):string

Add an item data array into the property itemData.

Parameters

Type

Name

Description

array

$itemData

Item data array.

public popItemDataBase():string

Calls array_pop against the property itemData.

public getDataField($field, $filter = null, $directiveType = "text", $htmlTagType = "span", $linkType = ""):string

Return a created HTML element. The content of the element is a TWIG statement to print a field from the item data.

Parameters

Type

Name

Description

string

$field

The accessor for the field in the item data.

string

$filter

Add a filter in the TWIG string.

string

$directiveType

Vue.js directive type for the element.

string

$htmlTagType

HTML Tag for element.

string

$linkType

If set to "file", the element gets the attribute target="_black".

public getDataFieldHtml($field, $filter = null):string

Call method getDataField with the directiveType "html".

Parameters

Type

Name

Description

string

$field

The accessor for the field in the item data.

string

$filter

Add a filter in the TWIG string.

public formatAgeRestriction($age):string

Convert an age to the assigned translation string.

Parameters

Type

Name

Description

int

$age

The age.

public formatDate($date):string

Format a date string.

Parameters

Type

Name

Description

string

$date

The date string.

public getGlobals():array

Return a map of global helper objects to add.