PHP 클래스 FluentDOM\Query\Attributes

It acts like the FluentDOM\Query::attr() method. If you read attributes it uses the first selected node. Write actions are applied to all matches element nodes.
상속: implements ArrayAccess, implements Countable, implements IteratorAggregate
파일 보기 프로젝트 열기: fluentdom/fluentdom

공개 메소드들

메소드 설명
__construct ( Query $fd ) Store the FluentDOM instance for later use
count ( ) : integer Get the attribute count of the first selected node
getIterator ( ) : Iterator Get an iterator for the attributes of the first node
offsetExists ( string $name ) : boolean Check if the first selected node has the specified attribute
offsetGet ( string $name ) : string Read the specified attribute from the first node
offsetSet ( string $name, string $value ) Set the attribute on all selected element nodes
offsetUnset ( string | array $name ) Remove the attribute(s) on all selected element nodes
toArray ( ) : array Convert the attributes of the first node into an array

비공개 메소드들

메소드 설명
getFirstElement ( ) : DOMElement | null

메소드 상세

__construct() 공개 메소드

Store the FluentDOM instance for later use
public __construct ( Query $fd )
$fd FluentDOM\Query

count() 공개 메소드

Get the attribute count of the first selected node
또한 보기: Countable::count()
public count ( ) : integer
리턴 integer

getIterator() 공개 메소드

Get an iterator for the attributes of the first node
또한 보기: IteratorAggregate::getIterator()
public getIterator ( ) : Iterator
리턴 Iterator

offsetExists() 공개 메소드

Check if the first selected node has the specified attribute
또한 보기: ArrayAccess::offsetExists()
public offsetExists ( string $name ) : boolean
$name string
리턴 boolean

offsetGet() 공개 메소드

Read the specified attribute from the first node
또한 보기: ArrayAccess::offsetGet()
또한 보기: FluentDOM::attr()
public offsetGet ( string $name ) : string
$name string
리턴 string

offsetSet() 공개 메소드

Set the attribute on all selected element nodes
또한 보기: ArrayAccess::offsetSet()
또한 보기: FluentDOM::attr()
public offsetSet ( string $name, string $value )
$name string
$value string

offsetUnset() 공개 메소드

Remove the attribute(s) on all selected element nodes
또한 보기: ArrayAccess::offsetUnset()
또한 보기: FluentDOM::removeAttr()
public offsetUnset ( string | array $name )
$name string | array

toArray() 공개 메소드

Convert the attributes of the first node into an array
public toArray ( ) : array
리턴 array