Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 851 Bytes

radio-list.md

File metadata and controls

36 lines (28 loc) · 851 Bytes

Radio List Field

Represents a list of radio buttons with a single selection. Documentation:

Usage Example

Widget:

use Yiisoft\Form\Field\RadioList;

echo RadioList::widget()
    ->items([
        'red' => 'Red',
        'blue' => 'Blue',
    ])
    ->name('RadioListForm[color]')
    ->label('Select color')
    ->hint('Color of box.');

Result will be:

<div>
    <label>Select color</label>
    <div>
        <label><input type="radio" name="RadioListForm[color]" value="red"> Red</label>
        <label><input type="radio" name="RadioListForm[color]" value="blue"> Blue</label>
    </div>
    <div>Color of box.</div>
</div>