Fr3nch13/CakePHP Utilities

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

Methods

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
string

secureFields()

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.


        
On this page

Search results