ColorWidget
in package
implements
WidgetInterface
Color Widget
Renders the html color widget on the frontend.
Table of Contents
Interfaces
- WidgetInterface
- Interface for input widgets.
Properties
- $_templates : StringTemplate
- StringTemplate instance.
Methods
- __construct() : mixed
- Constructor.
- render() : string
- Render a text widget or other simple widget like email/tel/number.
- secureFields() : array<string|int, mixed>
- Makes sure an array is returned.
Properties
$_templates
StringTemplate instance.
protected
StringTemplate
$_templates
Methods
__construct()
Constructor.
public
__construct(StringTemplate $templates) : mixed
Parameters
- $templates : StringTemplate
-
Templates list.
render()
Render a text widget or other simple widget like email/tel/number.
public
render(array<string, mixed> $data, ContextInterface $context) : string
This method accepts a number of keys:
-
name
The name attribute. -
val
The value attribute. -
escape
Set to false to disable escaping on all attributes.
Any other keys provided in $data will be converted into HTML attributes.
Parameters
- $data : array<string, mixed>
-
The data to build an input with.
- $context : ContextInterface
-
The current form context.
Return values
stringsecureFields()
Makes sure an array is returned.
public
secureFields([array<string, mixed> $data = [] ]) : array<string|int, mixed>
Parameters
- $data : array<string, mixed> = []
-
The data to be properly formatted.
Return values
array<string|int, mixed> —The data formatted into an array.