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.

Common / Family

Show “PagesType”             Show Arguments        


PagesType::__construct(ProcessWire $wire)
(nothing)Construct this PagesType manager for the given parent and template
PagesType::add(string $name)
Page or NullPageAdds a new page with the given $name and returns it
intReturn the number of pages in this type matching the given selector string
PagesType::delete(Page $page)
boolPermanently delete a page and its fields.
PagesType::find(string $selectorString)
PageArrayGiven a Selector string, return the Page objects that match in a PageArray.
Page, NullPage or nullGet the first match of your selector string
PagesType::save(Page $page)
boolSave a page object and its fields to database.


(nothing)Add one or more of parents that this PagesType represents
(nothing)Add one or more templates that this PagesType represents
stringGet the PHP class name used by Page objects of this type
Page or NullPageGet the parent Page object (or first parent Page object if there are multiple)
intGet the parent page ID used by this type (or first parent ID if there are multiple)
arrayGet the parent page IDs used by this type
PageArrayGet the parent Page objects in a PageArray
TemplateGet the template used by this type (or first template if there are multiple)
array or 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.115