PagesEditor::editor method

Auto-populate some fields for a new page that does not yet exist

Currently it does this:

  • Assigns a parent if one is not already assigned.
  • Sets up a unique page->name based on the format or title if one isn't provided already.
  • Assigns a sort value.
  • Populates any default values for fields.

Usage

$pages->editor->setupNew(Page $page);

Arguments

NameType(s)Description
$pagePage

Exceptions

Method can throw exceptions on error:

  • \Exception or WireException or \PDOException - if failure occurs while in DB transaction


$pages->editor methods and properties

API reference based on ProcessWire core version 3.0.252