public function &newOption($value = null, $inner = null, bool $selected = false, string $optgroup = ''): Option
    {
        /* @var $option \Core\Html\Form\Option */
        $option = $this->factory->create('Form\Option');

        if (isset($value)) {
            $option->setValue($value);
        }

        if (isset($inner)) {
            $option->setInner($inner);
        }

        if ($selected == true) {
            $option->isSelected();
        }

        $this->addOption($option, $optgroup);

        return $option;
    }
public function &newOption($value = null, $inner = null, bool $selected = false, string $optgroup = ''): Option
    {
        /* @var $option \Core\Html\Form\Option */
        $option = $this->factory->create('Form\Option');

        if (isset($value)) {
            $option->setValue($value);
        }

        if (isset($inner)) {
            $option->setInner($inner);
        }

        if ($selected == true) {
            $option->isSelected();
        }

        $this->addOption($option, $optgroup);

        return $option;
    }
public function & newOption ( $ value = null , $ inner = null , bool $ selected = false , string $ optgroup = '' ) : Option { /* @var $option \Core\Html\Form\Option */ $ option = $ this -> factory -> create ( 'Form\Option' ) ; if ( isset ( $ value ) ) { $ option -> setValue ( $ value ) ; } if ( isset ( $ inner ) ) { $ option -> setInner ( $ inner ) ; } if ( $ selected == true ) { $ option -> isSelected ( ) ; } $ this -> addOption ( $ option , $ optgroup ) ; return $ option ; }
Add an Option object to the options array

Use parameters to predefine the objects settings.
If inner parameter is not set, the value is the inner
content of option and has no value attribute.

@param string|int $value
Option value
@param
string|int Optional $inner
Option inner content
@param bool $selected
Selected flag
@param string $optgroup
Related optgroup

@return Option
Add an Option object to the options array