FormSpamProtectionExtension
class FormSpamProtectionExtension extends Extension (View source)
An extension to the Form class which provides the method enableSpamProtection() helper.
Traits
Provides extensions to this object to integrate it with standard config API methods.
Config options
allowed_actions | This is used by extensions designed to be applied to controllers. |
from Extension | |
default_spam_protector | string | ||
mappable_fields | array | ||
field_name | string |
Properties
protected | T | $owner | The object this extension is applied to. |
from Extension |
Methods
Called when this extension is added to a particular class
Temporarily modify the owner. The original owner is ensured to be restored
Clear the current owner, and restore extension to the state prior to the last setOwner()
Helper method to strip eval'ed arguments from a string that's passed to DataObject::$extensions or Object::add_extension().
Invoke extension point. This will prefer explicit extend
prefixed
methods.
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
Gets the uninherited value for the given config option
Instantiate a SpamProtector instance
Details
__construct()
No description
static
add_to_class(string $class, string $extensionClass, mixed $args = null)
Called when this extension is added to a particular class
setOwner(object $owner)
Set the owner of this extension.
mixed
withOwner(mixed $owner, callable $callback, array $args = [])
Temporarily modify the owner. The original owner is ensured to be restored
clearOwner()
Clear the current owner, and restore extension to the state prior to the last setOwner()
T
getOwner()
Returns the owner of this extension.
static string
get_classname_without_arguments(string $extensionStr)
Helper method to strip eval'ed arguments from a string that's passed to DataObject::$extensions or Object::add_extension().
mixed
invokeExtension(object $owner, string $method, array ...$arguments)
Invoke extension point. This will prefer explicit extend
prefixed
methods.
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
static SpamProtector|null
get_protector(array $options = null)
Instantiate a SpamProtector instance
Form
enableSpamProtection(array $options = [])
Activates the spam protection module.