public function setCustomHtmlAttrib($name, $value)
        {
            if (!is_string($name)) {
                throw new Exception(
                    'Invalid argument: $name must be a string'
                );
            }

            if (null !== $value && !is_string($value)) {
                throw new Exception(
                    'Invalid argument: $value must be a string or null'
                );
            }

            if (null === $value && isset($this->_customHtmlAttribs[$name])) {
                unset($this->_customHtmlAttribs[$name]);
            } else {
                $this->_customHtmlAttribs[$name] = $value;
            }

            return $this;
        }
public function setCustomHtmlAttrib($name, $value)
        {
            if (!is_string($name)) {
                throw new Exception(
                    'Invalid argument: $name must be a string'
                );
            }

            if (null !== $value && !is_string($value)) {
                throw new Exception(
                    'Invalid argument: $value must be a string or null'
                );
            }

            if (null === $value && isset($this->_customHtmlAttribs[$name])) {
                unset($this->_customHtmlAttribs[$name]);
            } else {
                $this->_customHtmlAttribs[$name] = $value;
            }

            return $this;
        }
public function setCustomHtmlAttrib ( $ name , $ value ) { if ( ! is_string ( $ name ) ) { throw new Exception ( 'Invalid argument: $name must be a string' ) ; } if ( null !== $ value && ! is_string ( $ value ) ) { throw new Exception ( 'Invalid argument: $value must be a string or null' ) ; } if ( null === $ value && isset ( $ this -> _customHtmlAttribs [ $ name ] ) ) { unset ( $ this -> _customHtmlAttribs [ $ name ] ) ; } else { $ this -> _customHtmlAttribs [ $ name ] = $ value ; } return $ this ; }
Sets a single custom HTML attribute

@param  string      $name            name of the HTML attribute
@param  string|null $value           value for the HTML attribute
@return Page         fluent interface, returns self
@throws Exception    if name is not string or value is
not null or a string
Sets a single custom HTML attribute