PagesLoader::loader method

Returns the first page matching the given selector with no exclusions

Usage

// basic usage
$page = $pages->loader->get($selector);

// usage with all arguments
$page = $pages->loader->get($selector, array $options = []);

Arguments

NameType(s)Description
$selectorstring int array Selectors
$options (optional)array

See Pages::find method for options

Return value

Page NullPage

Always returns a Page object, but will return NullPage (with id=0) when no match found


$pages->loader methods and properties

API reference based on ProcessWire core version 3.0.252