Copied!

Class Tag

  • package PHPHtmlParser\Dom
Cloneable Instantiable
Methods
public __construct ( string $name )
 

Sets up the tag with a name.

public __get ( $key )
 

Magic method to get any of the attributes.

  • return mixed
public __set ( $key , $value )
 

Magic method to set any attribute.

public getAttribute ( string $key ) : array
 

Returns an attribute by the key

  • return array
public getAttributes ()
 

Returns all attributes of this tag.

  • return array
public getStyleAttributeArray () : array
 

Get style attribute in array

  • return array
public hasAttribute ( string $key )
 

Returns TRUE if node has attribute

  • return bool
public isSelfClosing () : bool
 

Checks if the tag is self closing.

  • return bool
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.

  • return string
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 , $value ) : PHPHtmlParser\Dom\Tag
 

Set an attribute for this tag.

public setAttributes ( array $attr )
 

Sets the attributes for this tag

  • return $this
public setEncoding ( stringEncode\Encode $encode ) : void
 

Sets the encoding type to be used.

  • return void
public setHtmlSpecialCharsDecode ( $htmlSpecialCharsDecode = false ) : void
 
  • return void
public setStyleAttributeValue ( $attr_key , $attr_value ) : void
 

Set inline style attribute value.

Properties
protected $attr
 

The attributes of the tag.

  • var array
protected $encode
 

The encoding class to... encode the tags

  • var mixed
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
Properties
private $HtmlSpecialCharsDecode
 
  • var bool
© 2021 Bruce Wells
Search Namespaces \ Classes
Configuration