ChoiceListView

ChoiceListView

class ChoiceListView

Represents a choice list in templates.

A choice list contains choices and optionally preferred choices which are displayed in the very beginning of the list. Both choices and preferred choices may be grouped in {@link ChoiceGroupView} instances.

Properties

ChoiceGroupView[]|ChoiceView[] $choices The choices.
ChoiceGroupView[]|ChoiceView[] $preferredChoices The preferred choices.

Methods

__construct(array $choices = array(), array $preferredChoices = array())

Creates a new choice list view.

bool hasPlaceholder()

Returns whether a placeholder is in the choices.

Details

__construct(array $choices = array(), array $preferredChoices = array())

Creates a new choice list view.

Parameters

array $choices The choice views
array $preferredChoices The preferred choice views.

bool hasPlaceholder()

Returns whether a placeholder is in the choices.

A placeholder must be the first child element, not be in a group and have an empty value.

Return Value

bool

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.3/Symfony/Component/Form/ChoiceList/View/ChoiceListView.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部