FML/Controls/Control.php
public function addToggleFeature(Control $toggledControl, $labelName = ScriptLabel::MOUSECLICK, $onlyShow = false, $onlyHide = false)
    {
        $toggle = new Toggle($this, $toggledControl, $labelName, $onlyShow, $onlyHide);
        $this->addScriptFeature($toggle);
        return $this;
    }
public function addToggleFeature(Control $toggledControl, $labelName = ScriptLabel::MOUSECLICK, $onlyShow = false, $onlyHide = false)
    {
        $toggle = new Toggle($this, $toggledControl, $labelName, $onlyShow, $onlyHide);
        $this->addScriptFeature($toggle);
        return $this;
    }
public function addToggleFeature ( Control $ toggledControl , $ labelName = ScriptLabel :: MOUSECLICK , $ onlyShow = false , $ onlyHide = false ) { $ toggle = new Toggle ( $ this , $ toggledControl , $ labelName , $ onlyShow , $ onlyHide ) ; $ this -> addScriptFeature ( $ toggle ) ; return $ this ; }
Add a dynamic Feature toggling another Control

@api
@param Control $toggledControl Toggled Control
@param string  $labelName      (optional) Script label name
@param bool    $onlyShow       (optional) If it should only show the Control but not toggle
@param bool    $onlyHide       (optional) If it should only hide the Control but not toggle
@return static
Add a dynamic Feature toggling another Control