Line 13: Line 13:
 
|-
 
|-
 
|function
 
|function
|<code>public static function onFFAfterFormHandling( $formFields, &$responseHandler ) { ... }</code>
+
|<code>public static function onFFAfterFormHandling( $flexFormFields, &$responseHandler ) { ... }</code>
 
|-
 
|-
 
|hook
 
|hook
Line 21: Line 21:
 
|<code>FlexForm/src/Processors/Request/External.php. Method: runHook</code>
 
|<code>FlexForm/src/Processors/Request/External.php. Method: runHook</code>
 
|}
 
|}
 +
 +
The array <code>$flexFormFields</code> will be available and hold all submitted Form elements as '''name->value'''.
  
 
responseHandler function :
 
responseHandler function :

Revision as of 14:50, 24 May 2022

FFAfterFormHandling hook

When FlexForm is finished processing a submit form and just before it will set notification and return to the user, this Hook will run.

Allowing people to do additional actions with the information submitted by the Form.

FFAfterFormHandling
Available since version 1.1.14
Allows final actions on form values before output
function public static function onFFAfterFormHandling( $flexFormFields, &$responseHandler ) { ... }
hook $wgHooks['FFAfterFormHandling'][] = 'MyExtensionHooks::onFFAfterFormHandling';
called from FlexForm/src/Processors/Request/External.php. Method: runHook

The array $flexFormFields will be available and hold all submitted Form elements as name->value.

responseHandler function :

on error :

$responseHandler->setReturnType( HandleResponse::TYPE_ERROR );

$responseHandler->setReturnStatus( "Your general error info" );

$responseHandler->setReturnData( "Details information" );

on success you only have to return true. If you want to add a message that FlexForm should who, then you can do the following :

$responseHandler->setReturnType( HandleResponse::TYPE_SUCCESS);

$responseHandler->setReturnData( "Success information" );

Always return true;

ws-page-props