$pages
Built-in Methods Reference
- $pages->find("selector")
Find and return all pages matching the given selector string. Returns a filtered PageArray unless an include mode is specified.
- $pages->count("selector")
Count pages matching the selector. Returned count is filtered unless an include mode is specified.
- $pages->get("selector")
Get the page matching the given selector string without exclusions. Returns a Page, or a NullPage if not found.
- $pages->get(123)
Get the page matching the given numeric ID, with no exclusions. Returns a Page, or a NullPage if not found.
- $pages->get("/path/to/page/")
Get the page matching the given path/URL (relative to ProcessWire installation root), with no exclusions. Returns a Page, or a NullPage if not found.
- $pages->save($page)
Save any changes made to the given $page. Same as: $page->save() with no arguments.
- $pages->saveField($page, 'field')
Save just the named field from $page. (v2.1+) Same as: $page->save('field')
- $pages->trash($page)
Move the given page to the Trash.
- $pages->delete($page)
Permanently delete the given page and any attached media. Throws error when $page has children.
- $pages->delete($page, true)
Recursively delete $page and all it's children and attached media, permanently.
- $pages->clone($page)
Creates a brand new cloned copy of the given page (and any children) and returns it. (v2.1+)
- $pages->clone($page, $parent)
Like the above, but with a new $parent page specified. (v2.1+)
- $pages->clone($page, $parent, false)
Like the above, but only the given page will be cloned (and not any children). (v2.1+)