ProcessWire Developer API

Developing a site in ProcessWire

CheatsheetA quick reference of ProcessWire API variables, methods and properties – all on one page.

ConceptProcessWire’s API is inspired by jQuery and its style and syntax. Learn more about the concept behind the API here.

What is the API?ProcessWire’s API is a collection of variables, selectors, fluent interfaces and a modular plugin architecture. Read more about what makes up this API here.

Template FilesEvery time a page is loaded on your site, ProcessWire looks at what template is assigned to the page, loads it, gives it several API variables, and then runs it as a PHP script. This section covers the use of template files and serves as an introduction to using ProcessWire’s API with examples.

API VariablesProcessWire provides these variables to every template which provide full access to the API.

SelectorsA selector allows you to specify fields for finding a page or group of pages that match your criteria. Selectors in ProcessWire are loosely based around the idea and syntax of attribute selectors in jQuery.

Include & BootstrapProcessWire’s API and data can be used from other PHP scripts, including command line PHP scripts. It’s very easy to do, here’s how…

SyntaxPrevious versions of ProcessWire, as well as the CMSs that preceded it (like Dictator CMS) used a tagging syntax where you could reference a value in your template using a tag like {$title}. ProcessWire v2.0 works differently. Here’s why…

HooksProcessWire contains many methods that you may hook into in order to modify the behavior of the method. Hooks are typically attached by modules (most often autoload modules).

Plugin ModulesModules exist to enable a high level of extensibility and customization to an installation of ProcessWire. Modules are PHP files containing classes that adhere to ProcessWire’s Module interface.

Users & AccessProcessWire uses a role-based access-control system (RBAC). Users, pages and permissions are assigned to roles.Users inherit the permissions of their roles on pages that have the role enabled.

ArraysNearly all collections of items in ProcessWire are derived from the WireArray. The WireArray interface is one you will be interacting with regularly in the ProcessWire API whether you know it or not. This page documents all of the methods that are common to all WireArrays.

FieldtypesFieldtypes are modules that define a data type and field used to hold content for pages. Every field used in your site has a defined type that originates from a Fieldtype module.

Absolutely. Just do exactly as you described, and include('your-file.php'); Anything you can do in regular PHP you can do in ProcessWire. You would use a custom module instead if you wanted your code to be more easily shared with others or installed and version maintained across multiple installations.

It is possible. Actually PW's $database API variable works exactly like PHP's PDO library. It doesn't specifically extend PDO, but it does duplicate all of its methods and delegates them to PDO. So any PHP documentation for PDO also applies to PW's $database API variable.

Latest Forum Posts

Latest Blog Post

ProcessWire 3.0.76, a new front-end account module and much moreThis week we’ve got a new core version, a new version of the Uikit 3 admin theme, a new version of ProCache with SCSS and LESS support, plus a brand new module that provides user login, new user registration and a user profile editor, all for the front-end of your site. / Blog / RSSSeptember 22 6:02 pm