Class Tag.

Cloneable Instantiable
public __construct ( string $name )

Sets up the tag with a name.

public getAttribute ( string $key ) : PHPHtmlParser\DTO\Tag\AttributeDTO

Returns an attribute by the key.

  • throws AttributeNotFoundException
  • throws stringEncode\Exception
public getAttributes () : array

Returns all attributes of this tag.

  • throws stringEncode\Exception
  • return AttributeDTO []
public getStyleAttributeArray () : array

Get style attribute in array.

public hasAttribute ( string $key )

Returns TRUE if node has attribute.

  • return bool
public isSelfClosing () : bool

Checks if the tag is self closing.

public makeClosingTag ()

Generates the closing tag for this object.

  • return string
public makeOpeningTag ()

Generates the opening tag for this object.

  • return string
public name () : string

Returns the name of this tag.

public noise ( string $noise ) : PHPHtmlParser\Dom\Tag

Sets the noise for this tag (if any).

public noTrailingSlash () : PHPHtmlParser\Dom\Tag

Sets the tag to not use a trailing slash.

public removeAllAttributes ()

Removes all attributes on this tag.

  • return void
public removeAttribute ( $key )

Removes an attribute from this tag.

  • return void
public selfClosing () : PHPHtmlParser\Dom\Tag

Sets the tag to be self closing.

public setAttribute ( string $key , ? string $attributeValue , bool $doubleQuote = true ) : PHPHtmlParser\Dom\Tag

Set an attribute for this tag.

public setAttributes ( array $attr )

Sets the attributes for this tag.

  • return $this
public setClosing ( string $closing ) : PHPHtmlParser\Dom\Tag
public setEncoding ( stringEncode\Encode $encode ) : void

Sets the encoding type to be used.

public setHtmlSpecialCharsDecode ( $htmlSpecialCharsDecode = false ) : void
public setOpening ( string $opening ) : PHPHtmlParser\Dom\Tag
public setStyleAttributeValue ( $attr_key , $attr_value ) : void

Set inline style attribute value.

protected $attr

The attributes of the tag.

  • var AttributeDTO []
protected $encode

The encoding class to... encode the tags.

  • var Encode | null
protected $name

The name of the tag.

  • var string
protected $noise

Tag noise.

protected $selfClosing

Is this tag self closing.

  • var bool
protected $trailingSlash

If self-closing, will this use a trailing slash. />.

  • var bool
private $closing

What the closing tag for self-closing elements should be.

  • var string
private $HtmlSpecialCharsDecode
  • var bool
private $opening

What the opening of this tag will be.

  • var string
© 2021 Bruce Wells
Search Namespaces \ Classes