src/Potter/Utils/Form/Fields/Select.php
public function addChoice($_choice, $_value = null)
    {
        if (is_array($_choice)):
            $text  = array_get($_choice, 'label');
            $value = array_get($_choice, 'value');
            $atts  = array_except($_choice, ['label']);
        else:
            $text  = $_choice;
            $value = (is_null($_value)) ? $_choice : $_value;
            $atts  = ['value' => $value];
        endif;

        $choice = Element::create('option', $text);
        $choice->setAttributes($atts);

        if ($this->isSelected($value)) $choice->setAttribute('selected', 'selected');

        $this->choices->push($choice);

        return $this;
    }
public function addChoice($_choice, $_value = null)
    {
        if (is_array($_choice)):
            $text  = array_get($_choice, 'label');
            $value = array_get($_choice, 'value');
            $atts  = array_except($_choice, ['label']);
        else:
            $text  = $_choice;
            $value = (is_null($_value)) ? $_choice : $_value;
            $atts  = ['value' => $value];
        endif;

        $choice = Element::create('option', $text);
        $choice->setAttributes($atts);

        if ($this->isSelected($value)) $choice->setAttribute('selected', 'selected');

        $this->choices->push($choice);

        return $this;
    }
@param string|array $_choice
@param string       $_value

@return $this