PagePaths class

Enables page paths/urls to be queryable by selectors. Also offers potential for improved load performance. Builds an index at install (may take time on a large site).

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

Show class?             Show args?        

Common

NameReturnSummary 
PagePaths::getID(string $path)
int nullGiven a page path, return the page ID or NULL if not found. 
PagePaths::getLanguages()
Languages falseReturns Languages object or false if not available 
PagePaths::getMatchQuery(DatabaseQuerySelect $query, Selector $selector)
(nothing)Perform a path match for use by PageFinder 
PagePaths::getPageAndLanguageID($path)
arrayGiven a page path return array of [ page_id, language_id ] 
PagePaths::getPageID($path)
int nullGiven a page path, return the page ID or 0 if not found. 
PagePaths::getPageInfo(string $path)
array boolGet page information about a given path 
PagePaths::getPath(int $pageId)
string nullGiven a page ID, return the page path, NULL if not found, or boolean false if cannot be determined. 
PagePaths::getPaths(int $pageId)
arrayGiven a page ID, return all paths found for page 
PagePaths::getRootSegments()
arrayGet root segments 
PagePaths::isRootSegment(string $segment)
intIs given segment/page name a root segment? 
PagePaths::rebuild()
intRebuild all paths table starting with $page and descending to its children 
PagePaths::rootSegments array 
PagePaths::upgrade($fromVersion, $toVersion)
(nothing)Upgrade module

Additional methods and properties

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

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

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani