SilverWare\Validator\Validator
An extension of the SilverStripe validator class for the SilverWare validator.
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2017 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class Validator
extends Validator
{
- // members
- private static array $dependencies = ;
- protected array $rules = ;
- protected boolean $clientSide = true;
- protected boolean $serverSide = true;
- // methods
- public $this setClientSide()
- public boolean getClientSide()
- public $this setServerSide()
- public boolean getServerSide()
- public Backend getBackend()
- public $this setForm()
- public FieldList getFormFields()
- public FormField getDataField()
- public $this setRule()
- public $this setRules()
- public array getRulesForField()
- public array getRulesForFieldName()
- public array getClassesForForm()
- public array getAttributesForForm()
- public array getAttributesForField()
- public $this addRequiredField()
- public $this addRequiredFields()
- public boolean fieldIsRequired()
- public Rule configureRule()
- public boolean php()
Hierarchy
Extends
- SilverStripe\Forms\Validator
Members
private
- $dependencies
—
array
Defines the injector dependencies for this object.
protected
- $clientSide
—
boolean
If true, validation is performed client-side using JavaScript. - $rules
—
array
Holds the rules defined for this validator. - $serverSide
—
boolean
If true, validation is performed server-side using PHP.
Methods
public
- addRequiredField() — Adds a required rule for the form field with the specified name.
- addRequiredFields() — Adds required rules for each of the field names present in the given array (associative messages optional).
- configureRule() — Uses the validator backend to configure the given rule.
- fieldIsRequired() — Answers true if the field with the given name is required.
- getAttributesForField() — Answers the validator attributes for the given form field.
- getAttributesForForm() — Answers the validator attributes for the given form.
- getBackend() — Answers the validator backend in use for this validator.
- getClassesForForm() — Answers the validator classes for the given form.
- getClientSide() — Answers the value of the clientSide attribute.
- getDataField() — Answers a data field with the specified name.
- getFormFields() — Answers the list of fields from the associated form.
- getRulesForField() — Answers an array containing the rules for the given form field object.
- getRulesForFieldName() — Answers an array containing the rules for the field with the given name.
- getServerSide() — Answers the value of the serverSide attribute.
- php() — Performs server-side validation of the submitted form data.
- setClientSide() — Defines the value of the clientSide attribute.
- setForm() — Associates the form and data field instances with the validator and rules.
- setRule() — Sets the given rule for the form field with the given name.
- setRules() — Sets the rules for the form field with the given name from the given array, or the entire list of rules.
- setServerSide() — Defines the value of the serverSide attribute.