PageValues::getBracketValue()

Get value that ends with square brackets to get iterable value, filtered value or property value

Note: When requesting an iterable value, this method will return an empty array in cases where the Page::get() method would return null.

Example

$iterableValue = $page->get('field_name[]');

Usage

// basic usage
$mixed = $pageValues->getBracketValue(Page $page, string $key);

// usage with all arguments
$mixed = $pageValues->getBracketValue(Page $page, string $key, mixed $value = null);

Arguments

NameType(s)Description
$pagePage
$keystring
$value (optional)mixed

Value to use rather than pulling from $page

Return value

mixed


PageValues methods and properties

API reference based on ProcessWire core version 3.0.251