FormBuilderProcessorAction::formReady()

Called when form is ready to be rendered OR processed

At this stage the module has all required data and hooks can be added, etc. As a result, this is a good method for adding hooks that can apply to both form rendering and processing.

Example

// populate a logged-in user’s email address in the form
$user = $this->wire()->user;
if(!$user->isLoggedin()) return;
$form = $this->form();
$this->processor()->addHookBefore('renderReady', function($e) use($form, $user) {
  $inputfield = $form->getByName('email');
  if($inputfield) $inputfield->val($user->email);
});

Usage

$formBuilderProcessorAction->formReady();

FormBuilderProcessorAction methods and properties

API reference based on ProcessWire core version 3.0.252