public function setOption($key, $value)
    {
        if (!in_array($key, $this->availableOptions)) {
            throw new Exception\InvalidArgumentException('Invalid option for Tooltip');
        }

        if (is_bool($value)) {
            $value = $value ? 'true' : 'false';
        }

        if (!is_string($value)) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Invalid value for Tooltip, expected boolean or string, got "%s"',
                gettype($value)
            ));
        }

        $this->getElement()->addAttribute("data-$key", $value);

        return $this;
    }
public function setOption($key, $value)
    {
        if (!in_array($key, $this->availableOptions)) {
            throw new Exception\InvalidArgumentException('Invalid option for Tooltip');
        }

        if (is_bool($value)) {
            $value = $value ? 'true' : 'false';
        }

        if (!is_string($value)) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Invalid value for Tooltip, expected boolean or string, got "%s"',
                gettype($value)
            ));
        }

        $this->getElement()->addAttribute("data-$key", $value);

        return $this;
    }
public function setOption ( $ key , $ value ) { if ( ! in_array ( $ key , $ this -> availableOptions ) ) { throw new Exception \ InvalidArgumentException ( 'Invalid option for Tooltip' ) ; } if ( is_bool ( $ value ) ) { $ value = $ value ? 'true' : 'false' ; } if ( ! is_string ( $ value ) ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'Invalid value for Tooltip, expected boolean or string, got "%s"' , gettype ( $ value ) ) ) ; } $ this -> getElement ( ) -> addAttribute ( "data-$key" , $ value ) ; return $ this ; }
Set a single option to the Tooltip

@param string $key
@param string $value

@return \SxBootstrap\View\Helper\Bootstrap\Label
@throws Exception\InvalidArgumentException
Set a single option to the Tooltip