PagesType class

Provides an interface to the Pages class but specific to a given page class/type, with predefined parent and template.

This class is primarily used by the core as an alternative to $pages, providing an API for other Page types like User, Role, Permission, and Language. The $users, $roles, $permissions and $languages API variables are all instances of PagesType. This class is typically not instantiated on its own and instead acts as a base class which is extended.


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

Show class?             Show args?        

Family

NameReturnSummary 
PagesType::addParents($parents)
(nothing)Add one or more of parents that this PagesType represents 
PagesType::addTemplates($templates)
(nothing)Add one or more templates that this PagesType represents 
PagesType::getPageClass()
stringGet the PHP class name used by Page objects of this type 
PagesType::getParent()
Page NullPageGet the parent Page object (or first parent Page object if there are multiple) 
PagesType::getParentID()
intGet the parent page ID used by this type (or first parent ID if there are multiple) 
PagesType::getParentIDs()
arrayGet the parent page IDs used by this type 
PagesType::getParents()
PageArrayGet the parent Page objects in a PageArray 
PagesType::getTemplate()
TemplateGet the template used by this type (or first template if there are multiple) 
PagesType::getTemplates()
array TemplateGet the templates (plural) used by this type 
PagesType::setPageClass(string $class)
(nothing)Set the PHP class name to use for Page objects of this type 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.124

Twitter updates

  • New post: In this week’s post, we’ll take a look a look at the new website and focus on some parts of it and how they were built. Then we’ll dive into the latest version of ProcessWire on the dev branch, version 3.0.124— More
    11 January 2019
  • New ProcessWire main site rebuild ready for preview— More
    4 January 2019
  • Happy Holidays! This latest master version of ProcessWire contains hundreds of new additions, fixes, optimizations and more. This post covers all the highlights— More
    21 December 2018

Latest news

  • ProcessWire Weekly #245
    In the 245th issue of ProcessWire Weekly we're going to focus on some new documentation additions made just this week, cover a couple of new third party modules from Bernhard Baumrock, and introduce a magnificent new travel website called Uncover Colombia. Read on!
    Weekly.pw / 19 January 2019
  • ProcessWire 3.0.124 and new website launched
    In this week’s post, we’ll take a look a look at the new website and focus on some parts of it and how they were built. Then we’ll dive into the latest version of ProcessWire on the dev branch, version 3.0.124.
    Blog / 11 January 2019
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH