* label = @Translation("JSON Decoder for list data", context = "WSDecoder"),
* )
*/
classWSDecoderJSONListextendsWSDecoderJSON{
/**
* Returns help text to display with the key/token select input.
*/
publicfunctiongetKeyHelpText(){
return$this->t('Use the format markup_wrapper_element/key_1:key_2:..:key_n where markup_wrapper_element is optional (div, p, span, ol, ul) and key elements are separated by : ');
}
/**
* Retrieve the value for the given data key.
*
* This function retrieves data from $this->data that is,
* in this case, a list or array.
* If defined, $key will select that key from each list item.
* All selected data will be wrapped in markup and concatenated.
* $key is a string, with the format "markup_element/foo:bar"
* where markup_element suggests markup to wrap the items,
* and the character ':' delimiting the parts of the key.
* Valid markup elements are: div, ol, ul, span, p.
* I.E. The key div/foo:bar will retrieve $this->data[*]['foo']['bar']