public function build($itemName = '', $itemValue = '')
    {
        // Create hidden checkbox
        $fi = new FormInput($this->getHTMLDocument(), 'checkbox', $itemName, $id = '', $class = 'swt_chk', $itemValue, $required = false);
        $this->append($fi);

        // Set checked value for checkbox
        if ($this->active) {
            $fi->attr('checked', 'checked');
        }

        // Add switch
        $switch = $this->getHTMLDocument()->create('div', '', '', 'switch');
        $this->append($switch);

        return $this;
    }
public function build($itemName = '', $itemValue = '')
    {
        // Create hidden checkbox
        $fi = new FormInput($this->getHTMLDocument(), 'checkbox', $itemName, $id = '', $class = 'swt_chk', $itemValue, $required = false);
        $this->append($fi);

        // Set checked value for checkbox
        if ($this->active) {
            $fi->attr('checked', 'checked');
        }

        // Add switch
        $switch = $this->getHTMLDocument()->create('div', '', '', 'switch');
        $this->append($switch);

        return $this;
    }
public function build ( $ itemName = '' , $ itemValue = '' ) { // Create hidden checkbox $ fi = new FormInput ( $ this -> getHTMLDocument ( ) , 'checkbox' , $ itemName , $ id = '' , $ class = 'swt_chk' , $ itemValue , $ required = false ) ; $ this -> append ( $ fi ) ; // Set checked value for checkbox if ( $ this -> active ) { $ fi -> attr ( 'checked' , 'checked' ) ; } // Add switch $ switch = $ this -> getHTMLDocument ( ) -> create ( 'div' , '' , '' , 'switch' ) ; $ this -> append ( $ switch ) ; return $ this ; }
Build the switch button

@param string $itemName
@param string $itemValue

@return $this
@throws Exception
@throws InvalidArgumentException
Build the switch button