ProcessWire API Reference

API Variables


Primary

NameSummary
$pageClass used by all Page objects in ProcessWire.
$pagesThe $pages API variable enables loading and manipulation of Page objects, to and from the database.
$modulesLoads and manages all modules in ProcessWire.
$userThe $user API variable is a type of page representing the current user, and the User class is Page type used for all users.

Input & Output

NameSummary
$inputProvides a means to get user input from URLs, GET, POST, and COOKIE variables and more.
$sanitizerProvides methods for sanitizing and validating user input, preparing data for output, and more.
$sessionMaintains sessions in ProcessWire, authentication, persistent variables, notices and redirects.
$logEnables creation of logs, logging of events, and management of logs.

Users & Access

NameSummary
$userThe $user API variable is a type of page representing the current user, and the User class is Page type used for all users.
$usersManages all users (User objects) in ProcessWire.
$permissionsProvides management of all Permission pages independent of users, for access control.
$rolesProvides management of all Role pages for access control.

Utilities & Helpers

NameSummary
$cacheProvides easy, persistent caching of markup, strings, arrays or PageArray objects.
$datetimeThe $datetime API variable provides helpers for working with dates/times and conversion between formats.
$filesHelpers for working with files and directories.
$mailProvides an API interface to email and WireMail.

System

NameSummary
$configHolds ProcessWire configuration settings as defined in /wire/config.php and /site/config.php.
$databaseAll database operations in ProcessWire are performed via this PDO-style database class.
$fieldsManages all custom fields in ProcessWire, independently of any Fieldgroup.
$templatesManages and provides access to all the Templates.
$languagesAPI variable $languages enables access to all Language pages and various helper methods.
$classLoaderThe ProcessWire $classLoader API variable handles autoloading of classes and modules.
$urlsMaintains lists of file paths or URLs, primarily used by the ProcessWire $config->paths and $urls API variables.

Functions


View summary of all functions or jump directly to a function by clicking on it below:

Core Classes


Primary

NameSummary
WireWire is the base class for most ProcessWire classes and modules.
WireDataWireData is the base data-storage class used by many ProcessWire object types and most modules.
WireArrayWireArray is the base iterable array type used throughout the ProcessWire framework.

Pages

NameSummary
PageClass used by all Page objects in ProcessWire.
NullPageNullPage is a type of Page object returned by many API methods to indicate a non-match.
UserThe $user API variable is a type of page representing the current user, and the User class is Page type used for all users.
RoleRole is a type of Page used for grouping permissions to users.
PermissionPermission is a Page type used for storing an individual permission.

Arrays

NameSummary
WireArrayWireArray is the base iterable array type used throughout the ProcessWire framework.
PageArrayPageArray is a paginated type of WireArray that holds multiple Page objects.
PaginatedArrayPaginatedArray is a type of WireArray that supports pagination of items within it.

Modules

NameSummary
ModuleModule is the primary PHP interface for module types in ProcessWire.
FieldtypeFieldtype is a module type used to represent a type of field. All Fieldtype modules descend from this.
InputfieldInputfield is the base class for modules that collect user input for fields.
ProcessProcess modules are self contained applications that run in the ProcessWire admin.
TextformatterA simple module type that provides formatting of text fields.

Files & Images

NameSummary
PagefileRepresents a single file item attached to a page, typically via a File Fieldtype.
PagefilesPagefiles is a type of WireArray that contains Pagefile objects. It also acts as the value for multi-file fields in ProcessWire.
PageimageRepresents an image item attached to a page, typically via an Image Fieldtype.
PageimagesPageimages are a type of WireArray containing Pageimage objects. They represent the value of multi-image field in ProcessWire.
PagefilesManagerManages files and file directories for a page independent of a particular field.

Fields & Templates

NameSummary
FieldField represents a custom field that is used on a Page.
FieldgroupFieldgroup is a type of WireArray that holds a group of Field objects for template(s).
TemplateTemplate is a Page’s connection to fields (via a Fieldgroup), access control, and output via a template file.

Pro Modules

NameSummary
FormBuilderForm Builder: Create or edit forms and manage submitted entries.
ProCacheProCache: The ultimate caching and optimization tool for ProcessWire.

Additional

NameSummary
HookEventHookEvent is a type provided to hook functions with information about the event.
InputfieldWrapperA type of Inputfield that contains other Inputfield objects as children. Commonly a form or a fieldset.
MarkupPagerNavPager (Pagination) Navigation: Module for generating pagination markup automatically for paginated WireArray types.
PagesPathFinderEnables finding pages by path, optionally with URL segments, pagination numbers, language prefixes, etc.
PagesTypeProvides an interface to the Pages class but specific to a given page class/type, with predefined parent and template.
PathsMaintains lists of file paths or URLs, primarily used by the ProcessWire $config->paths and $urls API variables.
ProcessWireRepresents an instance of ProcessWire connected with a set of API variables.
SelectorSelector maintains a single selector consisting of field name, operator, and value.
SelectorsProcesses a selector string into a WireArray of Selector objects.
SessionCSRFProvides an API for cross site request forgery protection.
WireDatabaseBackupProcessWire Database Backup and Restore
WireHttpWireHttp enables you to send HTTP requests to URLs, download files, and more.
WireMailA module type that handles sending of email in ProcessWire
WireRandomIncludes methods for random strings, numbers, arrays and passwords.
WireTextToolsSpecific text and markup tools for ProcessWire $sanitizer and elsewhere.
WireUploadSaves uploads of single or multiple files, saving them to the destination path.

Fieldtypes

NameSummary
FieldtypeCheckboxCheckbox: This Fieldtype stores an ON/OFF toggle via a single checkbox. The ON value is 1 and OFF value is 0.
FieldtypeCommentsComments: Field that stores user posted comments for a single Page
FieldtypeDatetimeDatetime: Holds date and optionally time values.
FieldtypeEmailE-Mail: Fieldtype for holding an email address.
FieldtypeFieldsetCloseFieldset (Close): Fieldtype to close a FieldsetOpen
FieldtypeFieldsetOpenFieldset (Open): Open a fieldset to group fields. Should be followed by a Fieldset (Close) after one or more fields.
FieldtypeFieldsetTabOpenFieldset in Tab (Open): Open a fieldset to group fields. Same as Fieldset (Open) except that it displays in a tab instead.
FieldtypeFileFiles: Field that stores one or more files with optional description.
FieldtypeFloatFloat: Field that stores a floating point number.
FieldtypeImageImages: Field that stores one or more image files.
FieldtypeIntegerInteger: Field that stores an integer value.
FieldtypeLikesLikes: Holds quantity of "likes" for a given page
FieldtypeModuleModule Reference: Field that stores reference to another Module.
FieldtypeOptionsSelect Options: Field that stores single and multi select options.
FieldtypePagePage Reference: Field that stories references to one or more ProcessWire pages.
FieldtypePageTitlePage Title: Field that holds a Page title
FieldtypePasswordPassword: Fieldtype for holding a hashed and salted password
FieldtypeRepeaterRepeater: Maintains a collection of fields that are repeated for any number of times.
FieldtypeRepeaterMatrixProFields: Repeater Matrix: Commercial Fieldtype module providing multi-type repeaters.
FieldtypeTableProFields: Table: Field that lets you define a database table of custom fields.
FieldtypeTextText: Basic Field that stores text, typically a single line.
FieldtypeTextareaTextarea: Field that stores multiple lines of text
FieldtypeToggleToggle (Yes/No): Configurable yes/no, on/off toggle alternative to a checkbox, plus optional “other” option.
FieldtypeURLURL: Stores a valid URL value, whether local/relative or a URL that includes a protocol.
FieldtypeVerifiedURLProFields: Verified URL: and re-verifies it over time at set intervals.