FormControlOption
A single option for a form control, such as a select or radio button group.
Classname
Photon\CmsEngine\Model\Element\FormControlOption
Attributes
Attribute | Type | Description |
---|---|---|
$value | string | The content of the value attribute of the form control's HTML element |
$text | string | The label for this option |
<?php
use Photon\CmsEngine\Model\Element\FormControlOption;
$option = new FormControlOption();
$option->setValue('')
->setText('All Categories');
$options[] = $option;
foreach ($topLevelCategories as $topLevelCategory) {
$option = new FormControlOption();
$option->setValue($topLevelCategory->getId())
->setText($topLevelCategory->getTitle());
$options[] = $option;
}