PHP Class PHPHtmlParser\Dom\Tag

Afficher le fichier Open project: paquettg/php-html-parser Class Usage Examples

Protected Properties

Свойство Type Description
$attr array The attributes of the tag.
$encode mixed .. encode the tags
$name string The name of the tag.
$noise Tag noise
$selfClosing boolean Is this tag self closing.

Méthodes publiques

Méthode Description
__construct ( $name ) Sets up the tag with a name.
__get ( string $key ) : mixed Magic method to get any of the attributes.
__set ( string $key, mixed $value ) Magic method to set any attribute.
getAttribute ( string $key ) : mixed Returns an attribute by the key
getAttributes ( ) : array Returns all attributes of this tag.
isSelfClosing ( ) : boolean Checks if the tag is self closing.
makeClosingTag ( ) : string Generates the closing tag for this object.
makeOpeningTag ( ) : string Generates the opening tag for this object.
name ( ) : string Returns the name of this tag.
noise ( $noise ) Sets the noise for this tag (if any)
removeAllAttributes ( ) : void Removes all attributes on this tag.
removeAttribute ( $key ) : void Removes an attribute from this tag.
selfClosing ( ) Sets the tag to be self closing.
setAttribute ( string $key, string | array $value ) Set an attribute for this tag.
setAttributes ( array $attr ) Sets the attributes for this tag
setEncoding ( stringEncode\Encode $encode ) Sets the encoding type to be used.

Method Details

__construct() public méthode

Sets up the tag with a name.
public __construct ( $name )
$name

__get() public méthode

Magic method to get any of the attributes.
public __get ( string $key ) : mixed
$key string
Résultat mixed

__set() public méthode

Magic method to set any attribute.
public __set ( string $key, mixed $value )
$key string
$value mixed

getAttribute() public méthode

Returns an attribute by the key
public getAttribute ( string $key ) : mixed
$key string
Résultat mixed

getAttributes() public méthode

Returns all attributes of this tag.
public getAttributes ( ) : array
Résultat array

isSelfClosing() public méthode

Checks if the tag is self closing.
public isSelfClosing ( ) : boolean
Résultat boolean

makeClosingTag() public méthode

Generates the closing tag for this object.
public makeClosingTag ( ) : string
Résultat string

makeOpeningTag() public méthode

Generates the opening tag for this object.
public makeOpeningTag ( ) : string
Résultat string

name() public méthode

Returns the name of this tag.
public name ( ) : string
Résultat string

noise() public méthode

Sets the noise for this tag (if any)
public noise ( $noise )
$noise

removeAllAttributes() public méthode

Removes all attributes on this tag.
public removeAllAttributes ( ) : void
Résultat void

removeAttribute() public méthode

Removes an attribute from this tag.
public removeAttribute ( $key ) : void
$key
Résultat void

selfClosing() public méthode

Sets the tag to be self closing.
public selfClosing ( )

setAttribute() public méthode

Set an attribute for this tag.
public setAttribute ( string $key, string | array $value )
$key string
$value string | array

setAttributes() public méthode

Sets the attributes for this tag
public setAttributes ( array $attr )
$attr array

setEncoding() public méthode

Sets the encoding type to be used.
public setEncoding ( stringEncode\Encode $encode )
$encode stringEncode\Encode

Property Details

$attr protected_oe property

The attributes of the tag.
protected array $attr
Résultat array

$encode protected_oe property

.. encode the tags
protected mixed $encode
Résultat mixed

$name protected_oe property

The name of the tag.
protected string $name
Résultat string

$noise protected_oe property

Tag noise
protected $noise

$selfClosing protected_oe property

Is this tag self closing.
protected bool $selfClosing
Résultat boolean