SilverCart\Extensions\Forms\FormFields\FormFieldExtension
Extension for the default SilverStripe\Forms\FormField.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2018 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class FormFieldExtension
extends Extension
{
- // members
- public bool $validationFailed = false;
- protected array $requiredForced = ;
- // methods
- public string getPlaceholder()
- public FormField setPlaceholder()
- public bool getValidationFailed()
- public FormField setValidationFailed()
- public FormField setRequiredForced()
- public bool getRequiredForced()
- public FormField addErrorClass()
- public void updateAttributes()
- public bool HasRequiredProperty()
- protected array _templates()
- public array getCustomFieldTemplates()
- public DBHTMLText CustomFieldHolder()
Hierarchy
Extends
- SilverStripe\Core\Extension
Members
protected
- $requiredForced
—
array
Determines whether the field is required (forces).
public
- $validationFailed
—
SilverCart\Extensions\Forms\FormFields\bool
Determines whether the field validation failed.
Methods
protected
- _templates() — Generate an array of class name strings to use for rendering this form field into HTML.
public
- CustomFieldHolder() — Returns a "field holder" for this field.
- HasRequiredProperty() — Returns whether this form field needs the required HTML property.
- addErrorClass() — Adds a CSS class to the field if an error occured.
- getCustomFieldTemplates() — Returns an array of templates matching with the given $suffix to use for rendering.
- getPlaceholder() — Returns the placeholder
- getRequiredForced() — Returns whether the required attribute should be forced.
- getValidationFailed() — Returns whether the field validation failed.
- setPlaceholder() — Sets the placeholder
- setRequiredForced() — Forces the required attribute.
- setValidationFailed() — Sets whether the field validation failed.
- updateAttributes() — Updates the attributes.