interface SpamProtector (View source)

SpamProtector base interface.

All Protectors are required implement this interface if they want to appear on the form.

Classes with this interface are used to generate helper lists to allow the user to select the protector.

Methods

public
getFormField(string $name = null, string $title = null, mixed $value = null)

Return the FormField associated with this protector.

public
setFieldMapping(array $fieldMapping)

Set the fields to map spam protection too

Details

FormField getFormField(string $name = null, string $title = null, mixed $value = null)

Return the FormField associated with this protector.

Most spam methods will simply return a piece of HTML to be injected at the end of the form. If a spam method needs to inject more than one form field (i.e a hidden field and a text field) then return a FieldGroup from this method to include both.

Parameters

string $name
string $title
mixed $value

Return Value

FormField

The resulting field

setFieldMapping(array $fieldMapping)

Set the fields to map spam protection too

Parameters

array $fieldMapping

array of Field Names, where the indexes of the array are the field names of the form and the values are the standard spamprotection fields used by the protector