Legend of the Green Dragon

FormHidden extends FormInput

Base functionality for all form view helpers.

Table of Contents

$booleanAttributes  : array<string|int, mixed>
Standard boolean attributes, with expected values for enabling/disabling.
$defaultTranslatableHtmlAttributePrefixes  : array<string|int, mixed>
The default translatable HTML attribute prefixes.
$defaultTranslatableHtmlAttributes  : array<string|int, mixed>
The default translatable HTML attributes.
$escapeHtmlAttrHelper  : EscapeHtmlAttr
$lotgdKernel  : mixed
$lotgdKernelContainer  : mixed
$lotgdSymfonyTranslator  : mixed
$lotgdTranslator  : mixed
$serviceManager  : mixed
$translatableAttributePrefixes  : array<string|int, mixed>
Prefixes of translatable HTML attributes.
$translatableAttributes  : array<string|int, mixed>
Translatable attributes.
$translatorTextDomain  : string
Translation text domain.
$validGlobalAttributes  : array<string|int, mixed>
Attributes globally valid for all tags.
$validTagAttributePrefixes  : array<string|int, mixed>
Attribute prefixes valid for all tags.
$validTagAttributes  : array<string|int, mixed>
Attributes valid for the input tag type="hidden".
$validTypes  : array<string|int, mixed>
Valid values for the input type.
addDefaultTranslatableAttribute()  : mixed
Adds an HTML attribute to the list of the default translatable attributes.
addDefaultTranslatableAttributePrefix()  : mixed
Adds an HTML attribute to the list of translatable attributes.
addTranslatableAttribute()  : AbstractHelper
Adds an HTML attribute to the list of translatable attributes.
addTranslatableAttributePrefix()  : AbstractHelper
Adds an HTML attribute to the list of translatable attributes.
addValidAttribute()  : AbstractHelper
Adds an HTML attribute to the list of valid attributes.
addValidAttributePrefix()  : AbstractHelper
Adds a prefix to the list of valid attribute prefixes.
createAttributesString()  : string
Create a string of all attribute/value pairs.
getContainer()  : object
Get container.
getFunctions()  : mixed
{@inheritdoc}
getId()  : string|null
Get the ID of an element.
getKernel()  : Kernel
Get LoTGD Kernel.
getName()  : mixed
{@inheritdoc}
getService()  : mixed
Get container.
getTranslator()  : object|null
Get translator instance.
getTranslatorTextDomain()  : string
Return the translation text domain.
messageFormatter()  : string
Only format a message with MessageFormatter.
render()  : string
Render a form <input> element from the provided $element.
setContainer()  : mixed
Set container (Service Manager).
setTranslatorTextDomain()  : $this
Set translation text domain.
symfonyTranslator()  : Translator
Symfony Translator instance.
getEscapeHtmlAttrHelper()  : EscapeHtmlAttr
Retrieve the escapeHtmlAttr helper.
getType()  : string
Determine input type to use.
hasAllowedPrefix()  : bool
Whether the passed attribute has a valid prefix or not.
isValidAttributeName()  : bool
Whether the passed attribute is valid or not.
prepareAttributes()  : array<string|int, mixed>
Prepare attributes for rendering.
prepareBooleanAttributeValue()  : string
Prepare a boolean attribute value.
translateHtmlAttributeValue()  : string
Translates the value of the HTML attribute if it should be translated and this view helper has a translator.
cleanParameters()  : bool
Clean param of a value.

Properties

$booleanAttributes

Standard boolean attributes, with expected values for enabling/disabling.

protected array<string|int, mixed> $booleanAttributes = ['autocomplete' => ['on' => 'on', 'off' => 'off'], 'autofocus' => ['on' => 'autofocus', 'off' => ''], 'checked' => ['on' => 'checked', 'off' => ''], 'disabled' => ['on' => 'disabled', 'off' => ''], 'multiple' => ['on' => 'multiple', 'off' => ''], 'readonly' => ['on' => 'readonly', 'off' => ''], 'required' => ['on' => 'required', 'off' => ''], 'selected' => ['on' => 'selected', 'off' => '']]

$defaultTranslatableHtmlAttributePrefixes

The default translatable HTML attribute prefixes.

protected static array<string|int, mixed> $defaultTranslatableHtmlAttributePrefixes = []

$defaultTranslatableHtmlAttributes

The default translatable HTML attributes.

protected static array<string|int, mixed> $defaultTranslatableHtmlAttributes = ['title' => true]

$escapeHtmlAttrHelper

protected EscapeHtmlAttr $escapeHtmlAttrHelper

$lotgdKernelContainer

protected mixed $lotgdKernelContainer

$lotgdSymfonyTranslator

protected mixed $lotgdSymfonyTranslator

$lotgdTranslator

protected mixed $lotgdTranslator

$serviceManager

protected mixed $serviceManager

$translatableAttributePrefixes

Prefixes of translatable HTML attributes.

protected array<string|int, mixed> $translatableAttributePrefixes = []

$translatableAttributes

Translatable attributes.

protected array<string|int, mixed> $translatableAttributes = ['placeholder' => true]

$translatorTextDomain

Translation text domain.

protected string $translatorTextDomain = 'default'

$validGlobalAttributes

Attributes globally valid for all tags.

protected array<string|int, mixed> $validGlobalAttributes = ['accesskey' => true, 'class' => true, 'contenteditable' => true, 'contextmenu' => true, 'dir' => true, 'draggable' => true, 'dropzone' => true, 'hidden' => true, 'id' => true, 'lang' => true, 'onabort' => true, 'onblur' => true, 'oncanplay' => true, 'oncanplaythrough' => true, 'onchange' => true, 'onclick' => true, 'oncontextmenu' => true, 'ondblclick' => true, 'ondrag' => true, 'ondragend' => true, 'ondragenter' => true, 'ondragleave' => true, 'ondragover' => true, 'ondragstart' => true, 'ondrop' => true, 'ondurationchange' => true, 'onemptied' => true, 'onended' => true, 'onerror' => true, 'onfocus' => true, 'oninput' => true, 'oninvalid' => true, 'onkeydown' => true, 'onkeypress' => true, 'onkeyup' => true, 'onload' => true, 'onloadeddata' => true, 'onloadedmetadata' => true, 'onloadstart' => true, 'onmousedown' => true, 'onmousemove' => true, 'onmouseout' => true, 'onmouseover' => true, 'onmouseup' => true, 'onmousewheel' => true, 'onpause' => true, 'onplay' => true, 'onplaying' => true, 'onprogress' => true, 'onratechange' => true, 'onreadystatechange' => true, 'onreset' => true, 'onscroll' => true, 'onseeked' => true, 'onseeking' => true, 'onselect' => true, 'onshow' => true, 'onstalled' => true, 'onsubmit' => true, 'onsuspend' => true, 'ontimeupdate' => true, 'onvolumechange' => true, 'onwaiting' => true, 'role' => true, 'spellcheck' => true, 'style' => true, 'tabindex' => true, 'title' => true, 'xml:base' => true, 'xml:lang' => true, 'xml:space' => true]

$validTagAttributePrefixes

Attribute prefixes valid for all tags.

protected array<string|int, mixed> $validTagAttributePrefixes = ['data-', 'aria-', 'x-']

$validTagAttributes

Attributes valid for the input tag type="hidden".

protected array<string|int, mixed> $validTagAttributes = ['name' => true, 'disabled' => true, 'form' => true, 'type' => true, 'value' => true]

$validTypes

Valid values for the input type.

protected array<string|int, mixed> $validTypes = ['text' => 'text', 'button' => 'button', 'checkbox' => 'checkbox', 'file' => 'file', 'hidden' => 'hidden', 'image' => 'image', 'password' => 'password', 'radio' => 'radio', 'reset' => 'reset', 'select' => 'select', 'submit' => 'submit', 'color' => 'color', 'date' => 'date', 'datetime' => 'datetime', 'datetime-local' => 'datetime-local', 'email' => 'email', 'month' => 'month', 'number' => 'number', 'range' => 'range', 'search' => 'search', 'tel' => 'tel', 'time' => 'time', 'url' => 'url', 'week' => 'week']

Methods

addDefaultTranslatableAttribute()

Adds an HTML attribute to the list of the default translatable attributes.

public static addDefaultTranslatableAttribute(string $attribute) : mixed
Parameters
$attribute : string
Return values
mixed

addDefaultTranslatableAttributePrefix()

Adds an HTML attribute to the list of translatable attributes.

public static addDefaultTranslatableAttributePrefix(string $prefix) : mixed
Parameters
$prefix : string
Return values
mixed

addTranslatableAttribute()

Adds an HTML attribute to the list of translatable attributes.

public addTranslatableAttribute(string $attribute) : AbstractHelper
Parameters
$attribute : string
Return values
AbstractHelper

addTranslatableAttributePrefix()

Adds an HTML attribute to the list of translatable attributes.

public addTranslatableAttributePrefix(string $prefix) : AbstractHelper
Parameters
$prefix : string
Return values
AbstractHelper

addValidAttribute()

Adds an HTML attribute to the list of valid attributes.

public addValidAttribute(string $attribute) : AbstractHelper
Parameters
$attribute : string
Tags
throws
InvalidArgumentException

for attribute names that are invalid per the HTML specifications

Return values
AbstractHelper

addValidAttributePrefix()

Adds a prefix to the list of valid attribute prefixes.

public addValidAttributePrefix(string $prefix) : AbstractHelper
Parameters
$prefix : string
Tags
throws
InvalidArgumentException

for attribute prefixes that are invalid per the HTML specifications for attribute names

Return values
AbstractHelper

createAttributesString()

Create a string of all attribute/value pairs.

public createAttributesString(Environment $env, array<string|int, mixed> $attributes) : string

Escapes all attribute values

Parameters
$env : Environment
$attributes : array<string|int, mixed>
Return values
string

getContainer()

Get container.

public getContainer([string $name = null ]) : object
Parameters
$name : string = null
Tags
deprecated
4.10.0
Return values
object

getFunctions()

{@inheritdoc}

public getFunctions() : mixed
Return values
mixed

getId()

Get the ID of an element.

public getId(ElementInterface $element) : string|null

If no ID attribute present, attempts to use the name attribute. If no name attribute is present, either, returns null.

Parameters
$element : ElementInterface
Return values
string|null

getName()

{@inheritdoc}

public getName() : mixed
Return values
mixed

getService()

Get container.

public getService(string $name) : mixed
Parameters
$name : string
Return values
mixed

getTranslator()

Get translator instance.

public getTranslator() : object|null
Return values
object|null

getTranslatorTextDomain()

Return the translation text domain.

public getTranslatorTextDomain() : string
Return values
string

messageFormatter()

Only format a message with MessageFormatter.

public messageFormatter(string $message[, array<string|int, mixed>|null $parameters = [] ][, string|null $locale = null ]) : string
Parameters
$message : string
$parameters : array<string|int, mixed>|null = []
$locale : string|null = null
Return values
string

render()

Render a form <input> element from the provided $element.

public render(Environment $env, ElementInterface $element) : string
Parameters
$env : Environment
$element : ElementInterface
Tags
throws
DomainException
Return values
string

setContainer()

Set container (Service Manager).

public setContainer(ContainerInterface $container) : mixed
Parameters
$container : ContainerInterface
Tags
deprecated
4.10.0
Return values
mixed

setTranslatorTextDomain()

Set translation text domain.

public setTranslatorTextDomain([string $textDomain = 'default' ]) : $this
Parameters
$textDomain : string = 'default'
Return values
$this

symfonyTranslator()

Symfony Translator instance.

public symfonyTranslator() : Translator
Return values
Translator

getEscapeHtmlAttrHelper()

Retrieve the escapeHtmlAttr helper.

protected getEscapeHtmlAttrHelper() : EscapeHtmlAttr
Return values
EscapeHtmlAttr

getType()

Determine input type to use.

protected getType(ElementInterface $element) : string
Parameters
$element : ElementInterface
Return values
string

hasAllowedPrefix()

Whether the passed attribute has a valid prefix or not.

protected hasAllowedPrefix(string $attribute) : bool
Parameters
$attribute : string
Return values
bool

prepareAttributes()

Prepare attributes for rendering.

protected prepareAttributes(array<string|int, mixed> $attributes) : array<string|int, mixed>

Ensures appropriate attributes are present (e.g., if "name" is present, but no "id", sets the latter to the former).

Removes any invalid attributes

Parameters
$attributes : array<string|int, mixed>
Return values
array<string|int, mixed>

prepareBooleanAttributeValue()

Prepare a boolean attribute value.

protected prepareBooleanAttributeValue(string $attribute, mixed $value) : string

Prepares the expected representation for the boolean attribute specified.

Parameters
$attribute : string
$value : mixed
Return values
string

translateHtmlAttributeValue()

Translates the value of the HTML attribute if it should be translated and this view helper has a translator.

protected translateHtmlAttributeValue(Environment $env, string $key, string $value) : string
Parameters
$env : Environment
$key : string
$value : string
Return values
string

cleanParameters()

Clean param of a value.

private cleanParameters(mixed $param) : bool
Parameters
$param : mixed
Return values
bool

Search results