mirror of
https://github.com/silverstripe/silverstripe-spamprotection.git
synced 2024-10-22 14:05:59 +02:00
Merge pull request #57 from creative-commoners/pulls/3.0/update-docs
DOCS Add namespaces to class references in readme, fix typos
This commit is contained in:
commit
b4e9b6e5cb
30
README.md
30
README.md
@ -19,16 +19,16 @@ SilverStripe 4.0 or greater
|
|||||||
|
|
||||||
This module provides a generic, consistent API for adding spam protection to
|
This module provides a generic, consistent API for adding spam protection to
|
||||||
your SilverStripe Forms. This does not provide any spam protection out of the
|
your SilverStripe Forms. This does not provide any spam protection out of the
|
||||||
box, for that, you must also download one of the spam protection
|
box. For that, you must also download one of the spam protection
|
||||||
implementations. Currently available options are:
|
implementations. Currently available options are:
|
||||||
|
|
||||||
* [Mollom](https://github.com/silverstripe/silverstripe-mollom)
|
|
||||||
* [Recaptcha](https://github.com/chillu/silverstripe-recaptcha)
|
* [Recaptcha](https://github.com/chillu/silverstripe-recaptcha)
|
||||||
* [MathSpamProtection](https://github.com/silverstripe/silverstripe-mathspamprotection)
|
* [MathSpamProtection](https://github.com/silverstripe/silverstripe-mathspamprotection)
|
||||||
* [Akismet](https://github.com/tractorcow/silverstripe-akismet)
|
* [Akismet](https://github.com/silverstripe/silverstripe-akismet)
|
||||||
|
* [Mollom](https://github.com/silverstripe-archive/silverstripe-mollom)
|
||||||
|
|
||||||
As a developer you can also provide your own protector by creating a class which
|
As a developer you can also provide your own protector by creating a class which
|
||||||
implements the `SpamProtector` interface. More on that below.
|
implements the `\SilverStripe\SpamProtection\SpamProtector` interface. More on that below.
|
||||||
|
|
||||||
## Configuring
|
## Configuring
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ $form->enableSpamProtection();
|
|||||||
```
|
```
|
||||||
|
|
||||||
The logic to perform the actual spam validation is controlled by each of the
|
The logic to perform the actual spam validation is controlled by each of the
|
||||||
individual `SpamProtector` implementation since they each require a different
|
individual `SpamProtector` implementations since they each require a different
|
||||||
implementation client side or server side.
|
implementation client side or server side.
|
||||||
|
|
||||||
### Options
|
### Options
|
||||||
@ -72,15 +72,15 @@ $form->enableSpamProtection(array(
|
|||||||
|
|
||||||
Options to configure are:
|
Options to configure are:
|
||||||
|
|
||||||
*`protector`* a class name string or class instance which implements
|
* `protector`: a class name string or class instance which implements
|
||||||
`SpamProtector`. Defaults to your
|
`\SilverStripe\SpamProtection\SpamProtector`. Defaults to your
|
||||||
`FormSpamProtectionExtension.default_spam_protector` value.
|
`SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension.default_spam_protector` value.
|
||||||
|
|
||||||
*`name`* the form field name argument for the Captcha. Defaults to `Catcha`.
|
* `name`: the form field name argument for the Captcha. Defaults to `Captcha`.
|
||||||
*`title`* title of the Captcha form field. Defaults to `''`
|
* `title`: title of the Captcha form field. Defaults to `''`
|
||||||
*`insertBefore`* name of existing field to insert the spam protection field prior to
|
* `insertBefore`: name of existing field to insert the spam protection field prior to
|
||||||
*`mapping`* an array mapping of the Form fields to the standardized list of
|
* `mapping`: an array mapping of the Form fields to the standardised list of
|
||||||
field names. The list of standardized fields to pass to the spam protector are:
|
field names. The list of standardised fields to pass to the spam protector are:
|
||||||
|
|
||||||
```
|
```
|
||||||
title
|
title
|
||||||
@ -96,7 +96,7 @@ authorId
|
|||||||
|
|
||||||
## Defining your own `SpamProtector`
|
## Defining your own `SpamProtector`
|
||||||
|
|
||||||
Any class that implements `SpamProtector` and the `getFormField()` method can
|
Any class that implements `\SilverStripe\SpamProtection\SpamProtector` and the `getFormField()` method can
|
||||||
be set as the spam protector. The `getFormField()` method returns the
|
be set as the spam protector. The `getFormField()` method returns the
|
||||||
`FormField` to be inserted into the `Form`. The `FormField` returned should be
|
`FormField` to be inserted into the `Form`. The `FormField` returned should be
|
||||||
in charge of the validation process.
|
in charge of the validation process.
|
||||||
@ -130,7 +130,7 @@ currently selected SpamProtector instance.
|
|||||||
|
|
||||||
Spam protection is useful to provide but in some cases we do not want to require
|
Spam protection is useful to provide but in some cases we do not want to require
|
||||||
the developer to use spam protection. In that case, modules can provide the
|
the developer to use spam protection. In that case, modules can provide the
|
||||||
following pattern
|
following pattern:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use SilverStripe\Forms\Form;
|
use SilverStripe\Forms\Form;
|
||||||
|
Loading…
Reference in New Issue
Block a user