PageArray::getPage()

Like the base get() method but always returns a Page or NullPage rather than null/false.

Prefer this over get() when you need a consistent Page|NullPage return type, matching the behavior of $pages->get() at the database layer.

Available since version 3.0.162.

Usage

$page = $pageArray->getPage($key);

Arguments

NameType(s)Description
$keyint string array

Provide any of the following:

  • Key of Page to retrieve.
  • A selector string or selector array, to return the first item that matches the selector.
  • A string containing the "name" property of any Page, and the matching Page will be returned.

Return value

See Also


PageArray methods and properties

API reference based on ProcessWire core version 3.0.269