InputfieldPage::isValidPage() method

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.244

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.