PHP 클래스 PHPHtmlParser\Dom\Tag

파일 보기 프로젝트 열기: paquettg/php-html-parser 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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.

공개 메소드들

메소드 설명
__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.

메소드 상세

__construct() 공개 메소드

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

__get() 공개 메소드

Magic method to get any of the attributes.
public __get ( string $key ) : mixed
$key string
리턴 mixed

__set() 공개 메소드

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

getAttribute() 공개 메소드

Returns an attribute by the key
public getAttribute ( string $key ) : mixed
$key string
리턴 mixed

getAttributes() 공개 메소드

Returns all attributes of this tag.
public getAttributes ( ) : array
리턴 array

isSelfClosing() 공개 메소드

Checks if the tag is self closing.
public isSelfClosing ( ) : boolean
리턴 boolean

makeClosingTag() 공개 메소드

Generates the closing tag for this object.
public makeClosingTag ( ) : string
리턴 string

makeOpeningTag() 공개 메소드

Generates the opening tag for this object.
public makeOpeningTag ( ) : string
리턴 string

name() 공개 메소드

Returns the name of this tag.
public name ( ) : string
리턴 string

noise() 공개 메소드

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

removeAllAttributes() 공개 메소드

Removes all attributes on this tag.
public removeAllAttributes ( ) : void
리턴 void

removeAttribute() 공개 메소드

Removes an attribute from this tag.
public removeAttribute ( $key ) : void
$key
리턴 void

selfClosing() 공개 메소드

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

setAttribute() 공개 메소드

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

setAttributes() 공개 메소드

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

setEncoding() 공개 메소드

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

프로퍼티 상세

$attr 보호되어 있는 프로퍼티

The attributes of the tag.
protected array $attr
리턴 array

$encode 보호되어 있는 프로퍼티

.. encode the tags
protected mixed $encode
리턴 mixed

$name 보호되어 있는 프로퍼티

The name of the tag.
protected string $name
리턴 string

$noise 보호되어 있는 프로퍼티

Tag noise
protected $noise

$selfClosing 보호되어 있는 프로퍼티

Is this tag self closing.
protected bool $selfClosing
리턴 boolean