Create

wfv_create

This method will pass by reference an instance of FormComposite as described by the $array arguments.

You must call this method to actualize a validation. It takes the boring array of arguments and gives you a rich composite.

1
wfv_create( string $action, array &$form, bool $trim = true )

Parameter Type Default Description
$action string Unique identifier for the form
$form array Configuration array
$trim bool true Strip whitespace from beginning and end of input values

1
2
<?php
wfv_create( 'contact_form', $form );
$form is now an instance of WFV\FormComposite

Note

By default, WFV will trim leading and trailing whitespace from each input value.

If you do not desire this behavior, pass false as a third parameter when calling wfv_create()

eg:

1
2
<?php
wfv_create( 'my_form', $my_form, false );