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 LanguageReturns 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.236

Latest news

  • ProcessWire Weekly #552
    In the 552nd issue of ProcessWire Weekly we'll check out the latest weekly update from Ryan, take a quick look at a new e-commerce solution for ProcessWire, and more. Read on!
    Weekly.pw / 7 December 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

“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