Package

ViewHelpers

ViewHelper Documentation

form.select

This ViewHelper generates a

<f:form.select name="paymentOptions" options="{payPal: 'PayPal International Services', visa: 'VISA Card'}" value="visa" /> (Generates a dropdown box like above, except that "VISA Card" is selected.)

<f:form.select name="users" options="{userArray}" optionValueField="id" optionLabelField="firstName" /> (Generates a dropdown box, using ids and first names of the User instances.)

<f:form.select property="salutation" options="{salutations}" prependOptionLabel="- select one -" /> (depending on variable "salutations")

<f:form.select name="paymentOption" options="{payPal: 'PayPal International Services', visa: 'VISA Card'}" translate="{by: 'id'}" /> (Generates a dropdown box and uses the values "payPal" and "visa" to look up translations for those ids in the current package's "Main" XLIFF file.)

<f:form.select name="paymentOption" options="{payPal: 'PayPal International Services', visa: 'VISA Card'}" translate="{by: 'id', prefix: 'shop.paymentOptions.'}" /> (Generates a dropdown box and uses the values "shop.paymentOptions.payPal" and "shop.paymentOptions.visa" to look up translations for those ids in the current package's "Main" XLIFF file.)

Arguments

additionalAttributes anySimpleType

Additional tag attributes. They will be added directly to the resulting HTML tag.

data anySimpleType

Additional data-* attributes. They will each be added with a "data-" prefix.

name string

Name of input tag

value anySimpleType

Value of input tag

property string

Name of Object Property. If used in conjunction with <f:form object="...">, "name" and "value" properties will be ignored.

class string

CSS class(es) for this element

dir string

Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)

id string

Unique (in this file) identifier for this HTML element.

lang string

Language for this element. Use short names specified in RFC 1766

style string

Individual CSS styles for this element

title string

Tooltip text of element

accesskey string

Keyboard shortcut to access this element

tabindex integer

Specifies the tab order of this element

onclick string

JavaScript evaluated for the onclick event

multiple string

if set, multiple select field

size string

Size of input field

disabled boolean

Specifies that the input element should be disabled when the page loads

required boolean

Specifies that the select element requires at least one selected option

options anySimpleType

Associative array with internal IDs as key, and the values are displayed in the select box

optionValueField string

If specified, will call the appropriate getter on each object to determine the value.

optionLabelField string

If specified, will call the appropriate getter on each object to determine the label.

sortByOptionLabel boolean

If true, List will be sorted by label.

selectAllByDefault boolean

If specified options are selected if none was set before.

errorClass string

CSS class to set if there are errors for this ViewHelper

translate anySimpleType

Configures translation of ViewHelper output.

prependOptionLabel string

If specified, will provide an option at first position with the specified label.

prependOptionValue string

If specified, will provide an option at first position with the specified value. This argument is only respected if prependOptionLabel is set.

ViewHelper Resources

Schema Resources