ProcessWire2+ Cheatsheet 1.1
1 2 3 4

$pages

Built-in Methods Reference

$pages->find("selector")

$pages->count("selector")

$pages->get("selector")

$pages->get(123)

$pages->get("/path/to/page/")

+

$page

Built-in Fields Reference

$page->id

$page->name

$page->title

$page->path

$page->url

$page->httpUrl

$page->parent

$page->parentID

$page->parents

$page->rootParent

$page->template

$page->fields

$page->numChildren

$page->children

$page->child

$page->siblings

Built-in Methods Reference

$page->find($selector)

$page->get("field")

$page->get("field1|f2|f3")

$page->getUnformatted("field")

$page->setOutputFormatting(true|false)

$page->of(true|false)

$page->numChildren(bool)

$page->children($selector)

$page->child($selector)

$page->siblings($selector)

$page->parent($selector)

$page->parents($selector)

+

PageArray/WireArray

PageArray only

$a->getTotal()

$a->setTotal($n)

$a->getLimit()

$a->setLimit($n)

$a->getStart()

$a->setStart($n)

Getting Items

$a[$key]

$a->$key

$a->get($key)

$a->find("selector")

$a->get("selector")

$a->getRandom()

$a->findRandom($n)

$a->slice($n)

$a->slice($n, $limit)

$a->shift()

$a->pop()

$a->index($n)

$a->eq($n)

$a->first()

$a->last()

$a->getNext($item)

$a->getPrev($item)

Sorting and Filtering

$a->shuffle()

$a->sort("property")

$a->filter("selector")

$a->not("selector")

$a->reverse()

+

Files

Page Files Multiple (WireArray)

$files->path

$files->url

$files->page

$files->delete($file)

$file Properties

$file->url

$file->httpUrl

$file->filename

$file->name

$file->description

$file->ext

$file->filesize

$file->filesizeStr

(string) $file

$file Methods

$file->rename($name)

$image Properties (in addition to those in $file)

$image->width

$image->height

$image Methods

$image->size($width, $height, $options)

$image->width($width)

$image->height($height)

+

$templates

Methods

$templates->get("name")

Template Properties

$template->id

$template->name

$template->filename

$template->label

$template->cacheTime

$template->childrenTemplatesID

$template->allowPageNum

$template->urlSegments

$template->slashUrls

$template->redirectLogin

$template->protocol

Template Methods

+

$fields

Fields Methods

$fields->find("selector")

$fields->get("name")

$fields->get(123)

$fields->get("selector")

Field Properties

(string) $field

$field->id

$field->name

$field->label

Field Methods

$field->get($key)

$field->set($key, $value)

+

$users

Users Methods

$users->find("selector")

$users->get(name|id|selector)

+

$user

User Properties

$user->id

$user->name

$user->email

$user->pass

$user->roles

User Methods

$user->isGuest()

$user->isSuperuser()

$user->isLoggedin()

+

$roles

Roles Methods

$roles->find("selector")

$roles->get(name|id)

Role Properties

$role->id

$role->name

$role->permissions

Role Methods

$role->get($key)

+

$permissions

Permissions Methods

$permissions->find("selector")

$permissions->get(name|id)

Permission Properties

$permission->id

$permission->name

$permission->title

Permission Methods

$permission->get($key)

+

Selectors

Built-In Page Selector Properties

any_field=any_value

limit=n

sort=field

parent=id

parent=$page

parent=/path/to/page/

has_parent=$page

has_parent=id

has_parent=/path/to/page/

path=/path/to/page/

template=name

template=$template

Selector Operators

=

!=

<

>

<=

>=

*=

~=

%=

^=

$=

+

$input

Properties and Methods

$input->get

$input->get->name

$input->get["name"]

$input->get("name")

$input->post

$input->post->name

$input->post["name"]

$input->post("name")

$input->cookie

$input->cookie->name

$input->cookie["name"]

$input->cookie("name")

+

$sanitizer

Properties and Methods

$sanitizer->email($value)

$sanitizer->fieldName($value)

$sanitizer->name($value)

$sanitizer->pageName($value)

$sanitizer->pageName($value, true)

$sanitizer->selectorField($value)

$sanitizer->selectorValue($value)

$sanitizer->text($value)

$sanitizer->text($value, $options)

$sanitizer->textarea($value)

$sanitizer->textarea($value, $options)

$sanitizer->url($value)

$sanitizer->username($value)

$options

$session

Properties and Methods

$session->set($name, $value)

$session->get($name)

$session->$name = $value

$value = $session->$name

$session->getAll()

+

$config

Runtime Configuration

$config->ajax

$config->httpHost

$config->https

Urls

$config->urls->root

$config->urls->templates

Paths

$config->paths->root

$config->paths->templates

+