Skip to main content

FormControlOption

A single option for a form control, such as a select or radio button group.

Classname

Photon\CmsEngine\Model\Element\FormControlOption

Attributes

AttributeTypeDescription
$valuestringThe content of the value attribute of the form control's HTML element
$textstringThe 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;
}