ProcessWire API Reference

API Variables


Primary

NameSummary
PageClass used by all Page objects in ProcessWire.
PagesEnables 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
WireInputProvides 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.
WireLogEnables 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
WireCacheProvides easy, persistent caching of markup, strings, arrays or PageArray objects.
WireDateTimeThe $datetime API variable provides helpers for working with dates/times and conversion between formats.
WireFileToolsHelpers for working with files and directories.
WireMailToolsProvides an API interface to email and WireMail.

System

NameSummary
ConfigHolds ProcessWire configuration settings as defined in /wire/config.php and /site/config.php.
WireDatabasePDOAll 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.
WireClassLoaderThe ProcessWire $classLoader API variable handles autoloading of classes and modules.

Functions

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


Functions-API

cache(), config(), database(), datetime(), fields(), files(), input(), languages(), modules(), page(), pages(), paths(), permissions(), region(), roles(), sanitizer(), session(), setting(), templates(), urls(), user(), users(), wire()


Arrays

PageArray(), WireArray()


Class-helpers

wireClassExists(), wireClassImplements(), wireClassName(), wireClassParents(), wireInstanceOf(), wireIsCallable(), wireMethodExists()


Common

WireData(), wire(), wireCount(), wireDate(), wireInstance(), wireMail()


Files

wireChmod(), wireCopy(), wireIconMarkupFile(), wireIncludeFile(), wireMkdir(), wireRenderFile(), wireRmdir(), wireSendFile(), wireTempDir(), wireUnzipFile(), wireZipFile()


Markup

wireIconMarkup(), wireIconMarkupFile()


Strings

wireBytesStr(), wireDate(), wirePopulateStringTags(), wireRelativeTimeStr()


Translation

__(), _n(), _x()

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.

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.
WireHttpWireHttp enables you to send HTTP requests to URLs, download files, and more.
WireMailA module type that handles sending of email in ProcessWire
SessionCSRFProvides an API for cross site request forgery protection.
ProcessWireRepresents an instance of ProcessWire connected with a set of API variables.
PagesTypeProvides an interface to the Pages class but specific to a given page class/type, with predefined parent and template.
SelectorSelector maintains a single selector consisting of field name, operator, and value.
SelectorsProcesses a selector string into a WireArray of Selector objects.
WireDatabaseBackupProcessWire Database Backup and Restore
MarkupPagerNavPager (Pagination) Navigation: Module for generating pagination markup automatically for paginated WireArray types.

Twitter updates

  • New post: This week we take a look at what’s in ProcessWire 3.0.126 which focuses largely on resolving issue reports, but also includes a handy new Page if() method— More
    15 February 2019
  • New post: ProcessWire 3.0.125 has several useful new Sanitizer methods & options, plus new ways to access them directly from the Input API variable. This makes handling user input even easier than before. Plus updates to our i18n functions & API docs— More
    25 January 2019
  • 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

Newest forum posts

Latest news

  • ProcessWire Weekly #249
    In the 249th issue of ProcessWire Weekly we're going to walk you through the latest core updates (ProcessWire 3.0.126), introduce a new third party module called Page Access Releasetime, and pick a new site of the week. Read on!
    Weekly.pw / 16 February 2019
  • ProcessWire 3.0.126 core updates
    This week we take a look at what’s in ProcessWire 3.0.126 which focuses largely on resolving issue reports, but also includes a handy new $page->if() method. 
    Blog / 15 February 2019
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits