InputfieldPage::isValidPage()

Is the given $page valid for the given $field?

Note that this validates all but findPagesCode (eval) based page selections. This is primarily for use by FieldtypePage, but kept here since the config options it uses to check are part of this module's config.

If false is returned and given an $editPage, a reason for the false will be populated to the $editPage->_isValidPage property.

Usage

// basic usage
$bool = InputfieldPage::isValidPage(Page $page, $field);

// usage with all arguments
$bool = InputfieldPage::isValidPage(Page $page, $field, $editPage = null);

Arguments

NameType(s)Description
$pagePage
$fieldField InputfieldPage string int

Field instance of field name (string) or ID

$editPage (optional)Page null

Page being edited

Return value

bool

Exceptions

Method can throw exceptions on error:

  • WireException


InputfieldPage methods and properties

API reference based on ProcessWire core version 3.0.251