PageArray is a paginated type of WireArray that holds multiple Page objects.

Please see the WireArray and PaginatedArray types for available methods, as they are not repeated here, except where PageArray has modified or extended those types in some manner. The PageArray type is functionally identical to WireArray and PaginatedArray except that it is focused specifically on managing Page objects.

PageArray is returned by all API methods in ProcessWire that can return more than one page at once. $pages->find() and $page->children() are common examples.

The recommended way to create a new PageArray is to use the $pages->newPageArray() method:

$pageArray = $pages->newPageArray();

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the PageArray class also inherits all the methods and properties of: PaginatedArray, WireArray and Wire.


Name Return Summary  
PageArray::add($page) $this Add one or more Page objects to this PageArray.
PageArray::first Page or null First item
PageArray::getSelectors() Selectors or null Return the Selectors that led to this PageArray, or null if not set/applicable.
PageArray::last Page or null Last item

Additional methods and properties

In addition to the methods and properties above, PageArray also inherits the methods and properties of these classes: