Fully Qualified Name: | Laminas\Form\View\Helper\FormLabel |
Extends: | AbstractHelper |
Name | Description | Defined By |
---|---|---|
__invoke() | Generate a form label, optionally with content | FormLabel |
addDefaultTranslatableAttribute() | Adds an HTML attribute to the list of the default translatable attributes | AbstractHelper |
addDefaultTranslatableAttributePrefix() | Adds an HTML attribute to the list of translatable attributes | AbstractHelper |
addTranslatableAttribute() | Adds an HTML attribute to the list of translatable attributes | AbstractHelper |
addTranslatableAttributePrefix() | Adds an HTML attribute to the list of translatable attributes | AbstractHelper |
addValidAttribute() | Adds an HTML attribute to the list of valid attributes | AbstractHelper |
addValidAttributePrefix() | Adds a prefix to the list of valid attribute prefixes | AbstractHelper |
closeTag() | Return a closing label tag | FormLabel |
createAttributesString() | Create a string of all attribute/value pairs | AbstractHelper |
getDoctype() | Get value for doctype | AbstractHelper |
getEncoding() | Get character encoding | AbstractHelper |
getId() | Get the ID of an element | AbstractHelper |
getInlineClosingBracket() | Get the closing bracket for an inline tag | AbstractHelper |
getTranslator() | Returns translator used in helper | AbstractTranslatorHelper |
getTranslatorTextDomain() | Return the translation text domain | AbstractTranslatorHelper |
getView() | Get the view object | AbstractHelper |
hasTranslator() | Checks if the helper has a translator | AbstractTranslatorHelper |
isTranslatorEnabled() | Returns whether translator is enabled and should be used | AbstractTranslatorHelper |
openTag() | Generate an opening label tag | FormLabel |
setDoctype() | Set value for doctype | AbstractHelper |
setEncoding() | Set value for character encoding | AbstractHelper |
setTranslator() | Sets translator to use in helper | AbstractTranslatorHelper |
setTranslatorEnabled() | Sets whether translator is enabled and should be used | AbstractTranslatorHelper |
setTranslatorTextDomain() | Set translation text domain | AbstractTranslatorHelper |
setView() | Set the View object | AbstractHelper |
Generate a form label, optionally with content
Always generates a "for" statement, as we cannot assume the form input will be provided in the $labelContent.
Parameter Name | Type | Description |
---|---|---|
$element | \ElementInterface | |
$labelContent | null|string | |
$position | string |
Returns: string|\FormLabel
Adds an HTML attribute to the list of the default translatable attributes
Parameter Name | Type | Description |
---|---|---|
$attribute | string |
Returns:
Adds an HTML attribute to the list of translatable attributes
Parameter Name | Type | Description |
---|---|---|
$prefix | string |
Returns:
Adds an HTML attribute to the list of translatable attributes
Parameter Name | Type | Description |
---|---|---|
$attribute | string |
Returns: $this
Adds an HTML attribute to the list of translatable attributes
Parameter Name | Type | Description |
---|---|---|
$prefix | string |
Returns: $this
Adds an HTML attribute to the list of valid attributes
Parameter Name | Type | Description |
---|---|---|
$attribute | string |
Returns: $this
Adds a prefix to the list of valid attribute prefixes
Parameter Name | Type | Description |
---|---|---|
$prefix | string |
Returns: $this
Return a closing label tag
Returns: string
Create a string of all attribute/value pairs
Escapes all attribute values
Parameter Name | Type | Description |
---|---|---|
$attributes | array |
Returns: string
Get value for doctype
Returns: string
Get character encoding
Returns: string
Get the ID of an element
If no ID attribute present, attempts to use the name attribute. If no name attribute is present, either, returns null.
Parameter Name | Type | Description |
---|---|---|
$element | \ElementInterface |
Returns: null|string
Get the closing bracket for an inline tag
Closes as either "/>" for XHTML doctypes or ">" otherwise.
Returns: string
Returns translator used in helper
Returns: \Translator|null
Return the translation text domain
Returns: string
Get the view object
Returns: null|\Renderer
Checks if the helper has a translator
Returns: bool
Returns whether translator is enabled and should be used
Returns: bool
Generate an opening label tag
Parameter Name | Type | Description |
---|---|---|
$attributesOrElement | null|array|\ElementInterface |
Returns: string
Set value for doctype
Parameter Name | Type | Description |
---|---|---|
$doctype | string |
Returns: $this
Set value for character encoding
Parameter Name | Type | Description |
---|---|---|
$encoding | string |
Returns: $this
Sets translator to use in helper
Parameter Name | Type | Description |
---|---|---|
$translator | \Translator|null | Default |
$textDomain | string|null | Default |
Returns: $this
Sets whether translator is enabled and should be used
Parameter Name | Type | Description |
---|---|---|
$enabled | bool |
Returns: $this
Set translation text domain
Parameter Name | Type | Description |
---|---|---|
$textDomain | string |
Returns: $this
Set the View object
Parameter Name | Type | Description |
---|---|---|
$view | \Renderer |
Returns: \AbstractHelper