PagesLoader class

Located in file /wire/core/PagesLoader.php

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

Show class?             Show args?        

Common

NameReturnSummary 
PagesLoader::count()
intCount and return how many pages will match the given selector string 
PagesLoader::debug()
boolGet or set debug state 
PagesLoader::find($selector)
PageArray arrayGiven a Selector string, return the Page objects that match in a PageArray. 
PagesLoader::findByName(string $name)
array NullPage Page PageArrayFind page(s) by name 
PagesLoader::findCache($selector)
PageArray arrayFind pages and cache the result for specified period of time 
PagesLoader::findMin($selector)
PageArrayMinimal find for reduced or delayed overload in some circumstances 
PagesLoader::findOne($selector)
Page NullPageLike find() but returns only the first match as a Page object (not PageArray) 
PagesLoader::get($selector)
Page NullPageReturns the first page matching the given selector with no exclusions 
PagesLoader::getAutojoin()
boolGet whether autojoin is enabled for page loading queries 
PagesLoader::getById($_ids)
PageArray Page NullPageGiven an array or CSV string of Page IDs, return a PageArray 
PagesLoader::getByPath(string $path)
Page intGet a page by its path, similar to $pages->get('/path/to/page/') but with more options 
PagesLoader::getLastPageFinder()
PageFinder nullGet last used instance of PageFinder (for debugging purposes) 
PagesLoader::getNativeColumnValue($id, string $column)
int string boolGet value of of a native column in pages table for given page ID 
PagesLoader::getNativeColumns()
arrayReturns an array of all columns native to the pages table 
PagesLoader::getNumChildren($page)
intLoad total number of children from DB for given page 
PagesLoader::getOutputFormatting()
boolGet whether loaded pages have their outputFormatting turned on or off 
PagesLoader::getPath($id)
stringGiven an ID return a path to a page, without loading the actual page 
PagesLoader::getTotalPagesLoaded()
intReturn the total quantity of pages loaded by getById() 
PagesLoader::has($selector)
array intIs there any page that matches the given $selector in the system? (with no exclusions) 
PagesLoader::isLoading()
boolAre we currently loading pages? 
PagesLoader::isNativeColumn($columnName)
boolIs the given column name native to the pages table? 
PagesLoader::setAutojoin()
(nothing)Enable or disable use of autojoin for all queries 
PagesLoader::setOutputFormatting()
(nothing)Set whether loaded pages have their outputFormatting turned on or off 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #550
    In the 550th issue of ProcessWire Weekly we're going to check out the latest core updates, introduce a new third party module called PagefileMetadata, and more. Read on!
    Weekly.pw / 23 November 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.