PagesRaw::find()

Find pages and return raw data from them in a PHP array

Available since version 3.0.172.

Usage

// basic usage
$array = $pagesRaw->find($selector);

// usage with all arguments
$array = $pagesRaw->find($selector, $field = '', array $options = []);

Arguments

NameType(s)Description
$selectorstring array Selectors
$field (optional)string array Field

Name of field/property to get, or array of them, CSV string, or omit to get all Default:''

  • Optionally use associative array to rename fields in returned value, i.e. ['title' => 'label'] returns 'title' as 'label' in return value.
  • Specify parent.field_name or parent.parent.field_name, etc. to return values from parent(s). 3.0.193+
  • Specify references or references.field_name, etc. to also return values from pages referencing found pages. 3.0.193+
  • Specify meta or meta.name to also return values from page meta data. 3.0.193+
$options (optional)array

See options for Pages::find

  • objects (bool): Use objects rather than associative arrays? Default:false
  • entities (bool|array): Entity encode string values? True, or specify array of field names. Default:false
  • nulls (bool): Populate nulls for field values that are not present, rather than omitting them? Default:false 3.0.198+
  • indexed (bool): Index by page ID? Default:true
  • flat (bool|string): Flatten return value as ["field.subfield" => "value"] rather than ["field" => ["subfield" => "value"]]? Optionally specify field delimiter, otherwise a period . will be used as the delimiter. Default:false 3.0.193+
  • Note the objects and flat options are not meant to be used together.

Return value

array


PagesRaw methods and properties

API reference based on ProcessWire core version 3.0.251