Skip to content
PHP Ecosystem
Explore

ChoiceListInterface

API reference › HTML Contracts › Form › ChoiceListInterface

interfaceUIAwesome\Html\Contracts\Form\ChoiceListInterface
Sourcesrc/Form/ChoiceListInterface.php
Implemented by 1 type

Defines the contract for form controls that render a list of choices.

Applies to grouped controls such as checkbox and radio lists. Wrapping each choice in its own <label> element is exclusive to list controls, so enclosedByLabel() belongs to this contract rather than to a standalone one.

MethodDescriptionDefined by
enclosedByLabel() abstractSets whether each choice is wrapped by its own <label> element.ChoiceListInterface
isList() abstractIdentifies the control as one that renders a list of choices.ChoiceListInterface
abstract public function enclosedByLabel(bool $value = true): static

Sets whether each choice is wrapped by its own <label> element.

Parameters

ParameterTypeDescription
$valueboolWhether to enclose each choice by a <label> element.

Returns

static: New instance with the updated enclosing behavior.

abstract public function isList(): true

Identifies the control as one that renders a list of choices.

Returns

true: Always true.