PagesLoader::findByName() method

Find page(s) by name

This method is optimized just for finding pages by name and it does not perform any filtering or access checking.

Usage

// basic usage
$array = $pagesLoader->findByName(string $name);

// usage with all arguments
$array = $pagesLoader->findByName(string $name, array $options = []);

Arguments

NameType(s)Description
namestring

Match this page name

options (optional)array
  • `parent' (int|Page): Match this parent ID (default=0)
  • parentName (string): Match this parent name (default='')
  • getArray (bool): Get PHP info array rather than Page|NullPage|PageArray? (default=false)
  • getOne (bool|int): Get just one match of Page or NullPage? (default=false) When true, if multiple pages match then NullPage will be returned. To instead return the first match, specify int 1 instead of boolean true.

Return value


PagesLoader methods and properties

API reference based on ProcessWire core version 3.0.200

Twitter updates

  • Weekly update: Smooth rollout for ProcessWire 3.0.200 main/master, plus getting started on a new WP-to-PW site conversion and why they can be so rewarding— More
    20 May 2022
  • New main/master version of ProcessWire that has more than 220 commits, resolves more than 80 issues, adds numerous new features, performance improvements and optimizations, and consumes HALF the disk space of our previous release— More
    13 May 2022
  • Summary of weekly core updates for 22 April 2022 More
    22 April 2022

Latest news

  • ProcessWire Weekly #419
    In issue 419 of ProcessWire Weekly we'll check out this week's core updates, introduce a brand new recipe of the week, and more. Read on!
    Weekly.pw / 21 May 2022
  • ProcessWire 3.0.200 new master/main version
    This new main/master version has more than 220 commits, resolves more than 80 issues, adds numerous new features, performance improvements and optimizations, and consumes HALF the disk space of our previous release. This post covers all the details.
    Blog / 13 May 2022
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits