\Cake\View\HelperIdGeneratorTrait

A trait that provides id generating methods to be used in various widget classes.

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No constants found
_clearIds()
_id()
_domId()
$_idPrefix
$_idSuffixes
N/A
No private methods found
No private properties found
N/A

Properties

$_idPrefix

$_idPrefix : string|null

Prefix for id attribute.

Type

string|null

$_idSuffixes

$_idSuffixes : array

A list of id suffixes used in the current rendering.

Type

array

Methods

_clearIds()

_clearIds() : void

Clear the stored ID suffixes.

_id()

_id(string  $name, string  $val) : string

Generate an ID attribute for an element.

Ensures that id's for a given set of fields are unique.

Parameters

string $name

The ID attribute name.

string $val

The ID attribute value.

Returns

string —

Generated id.

_domId()

_domId(string  $value) : string

Generate an ID suitable for use in an ID attribute.

Parameters

string $value

The value to convert into an ID.

Returns

string —

The generated id.