SilverWare\Validator\Backend
An extension of the object class for the abstract parent class of validator backends.
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2017 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class Backend
{
- // members
- private static array $required_js = ;
- private static array $required_css = ;
- private static array $attribute = ;
- private static array $mappings = ;
- protected Validator $frontend;
- // methods
- public void __construct()
- public $this setFrontend()
- public Validator getFrontend()
- public array getClassesForForm()
- public array getAttributesForForm()
- public array getAttributesForField()
- public string getHTMLClass()
- public void doInit()
- public string attr()
- public string prefix()
- public string getMapping()
- public boolean hasMapping()
- public array getMappings()
- public string getDefaultAttribute()
- public Rule configureRule()
- public array getRequiredJS()
- public array getRequiredCSS()
- public void loadRequirements()
- protected void init()
- protected array flatten()
- protected array getRuleConfig()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
- SilverStripe\Core\Extensible
- SilverStripe\Core\Injector\Injectable
Members
private
- $attribute
—
array
The attribute configuration used for this backend. - $mappings
—
array
The attribute mappings defined for this backend. - $required_css
—
array
An array of required CSS files. - $required_js
—
array
An array of required JavaScript files.
protected
- $frontend
—
SilverWare\Validator\Validator
The validator frontend associated with this backend.
Methods
protected
- flatten() — Flattens the given array of attributes.
- getRuleConfig() — Answers the configuration array for the provided rule.
- init() — Initialises the validator backend.
public
- __construct() — Constructs the object upon instantiation.
- attr() — Answers the appropriate validator attribute name for the given mapping name and arguments.
- configureRule() — Applies configuration to the provided validator rule.
- doInit() — Initialises the validator backend (with extension hooks).
- getAttributesForField() — Answers an array of the validator attributes for the given form field.
- getAttributesForForm() — Answers an array of the validator attributes for the given form.
- getClassesForForm() — Answers an array of the validator classes for the given form.
- getDefaultAttribute() — Answers the default attribute name from configuration.
- getFrontend() — Answers the value of the Frontend attribute.
- getHTMLClass() — Answers the HTML class name for the receiver.
- getMapping() — Answers the attribute mapping with the given name.
- getMappings() — Answers the configured attribute mappings for the receiver.
- getRequiredCSS() — Answers an array of CSS files required by the receiver.
- getRequiredJS() — Answers an array of JavaScript files required by the receiver.
- hasMapping() — Answers true if an attribute mapping exists with the given name.
- loadRequirements() — Loads the CSS and scripts required by the receiver.
- prefix() — Prefixes the given attribute name (if required).
- setFrontend() — Defines the value of the frontend attribute.