Baigudin Software avatar
Baigudin Software logo
home
ru region
en region

PHP DOM Builder API

BOOS Core has been released as version 2.1

The new release of BOOS Core has gotten ARM architecture with instruction set version 5, some independent algorithms of any compilers, root interface for all interfaces, and many tiny aspects, which were implemented in it.

Interface «DomBuilder\Api\Fetch»

Elements fetch by properties access declaration.

  • interface Api\Fetch

All superinterfaces:

Object

public Element|Element[]|false get(int|string $index=NULL);

Returns an element of elements by index or an array of elements.

The method returns an elements array as vector if argument is not given. If argument greater than or equal zero, method returns an element with given index. If argument less than zero, method counts an index from the end of the elements list. For example: [-1] returns the last element, [-2] returns the penultimate element, etc.

Parameters:
int|string $index — element index of this elements or associative string key.

Returns:
Element|Element[]|false — an element for integer or string argument, or an elements array if argument is not given.

public Element|false getElementById(string $id);

Returns first child element with the specified ID.

Note: Any valid HTML documents must have only one tag with unique identifier.

Parameters:
string $id — ID value.

Returns:
Element|false — searched element.

public Element getElementsByAttr(string $name, string $value=NULL);

Returns child elements with the specified attribute name and its value of each element.

Parameters:
string $name — attribute name.
string $value — attribute value.

Returns:
Element — searched result.

public Element getElementsByClassName(string $name);

Returns child elements with the specified class name of each element.

Parameters:
string $name — class name.

Returns:
Element — searched result.

public Element getElementsById(string $id);

Returns child elements with the specified ID of each element.

Note: Any valid HTML documents must have only one tag with unique identifier.

Parameters:
string $id — ID value.

Returns:
Element — searched result.

public Element getElementsByTagName(string $name);

Returns child elements with the specified tag name of each element.

Parameters:
string $name — tag name.

Returns:
Element — searched result.

public Element getParentsByAttr(string $name, string $value=NULL);

Returns parent elements with the specified attribute name and its value of each element.

Parameters:
string $name — attribute name.
string $value — attribute value.

Returns:
Element — searched result.

public Element getParentsByClassName(string $name);

Returns parent elements with the specified class name of each element.

Parameters:
string $name — class name.

Returns:
Element — searched result.

public Element getParentsById(string $id);

Returns parent elements with the specified ID of each element.

Note: Any valid HTML documents must have only one tag with unique identifier.

Parameters:
string $id — ID value.

Returns:
Element — searched result.

public Element getParentsByTagName(string $name);

Returns parent elements with the specified tag name of each element.

Parameters:
string $name — tag name.

Returns:
Element — searched result.

Back to class list