W3cubDocs

/CakePHP 4.1

Trait IdGeneratorTrait

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

Namespace: Cake\View\Helper

Properties summary

  • $_idPrefix protected
    string|null

    Prefix for id attribute.

  • $_idSuffixes protected
    string[]

    A list of id suffixes used in the current rendering.

Method Summary

  • _clearIds() protected

    Clear the stored ID suffixes.

  • _domId() protected

    Generate an ID suitable for use in an ID attribute.

  • _id() protected

    Generate an ID attribute for an element.

  • _idSuffix() protected

    Generate an ID suffix.

Method Detail

_clearIds() protected

_clearIds()

Clear the stored ID suffixes.

_domId() protected

_domId(string $value)

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.

_id() protected

_id(string $name, string $val)

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.

_idSuffix() protected

_idSuffix(string $val)

Generate an ID suffix.

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

Parameters

string $val

The ID attribute value.

Returns

string

Generated id suffix.

Property Detail

$_idPrefix protected

Prefix for id attribute.

Type

string|null

$_idSuffixes protected

A list of id suffixes used in the current rendering.

Type

string[]

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/trait-Cake.View.Helper.IdGeneratorTrait.html