init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
11
lib/sd/manual/docs/api/simple_html_dom_node/__construct.md
Normal file
11
lib/sd/manual/docs/api/simple_html_dom_node/__construct.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# __construct
|
||||
|
||||
```php
|
||||
__construct ( [ object $dom ] ) : object
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `dom` | An object of type [`simple_html_dom`](api/simple_html_dom/).
|
||||
|
||||
Constructs a new object of type `simple_html_dom_node`, assignes `$dom` as DOM object and adds itself to the list of nodes in `$dom`.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# __destruct
|
||||
|
||||
```php
|
||||
__destruct ( )
|
||||
```
|
||||
|
||||
Destructs the current object and frees memory.
|
||||
22
lib/sd/manual/docs/api/simple_html_dom_node/__get.md
Normal file
22
lib/sd/manual/docs/api/simple_html_dom_node/__get.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# __get
|
||||
|
||||
```php
|
||||
__get ( string $name ) : mixed
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `name` | `outertext`, `innertext`, `plaintext`, `xmltext` or attribute name.
|
||||
|
||||
See [magic methods](http://php.net/manual/en/language.oop5.overloading.php#object.get)
|
||||
|
||||
If the provided name is a valid attribute name, returns the attribute value. Otherwise a value according to the table below.
|
||||
|
||||
| Name | Description
|
||||
| ---- | -----------
|
||||
| `outertext` | Returns the outer text of the current node.
|
||||
| `innertext` | Returns the inner text of the current node.
|
||||
| `plaintext` | Returns the plain text of the current node.
|
||||
| `xmltext` | Returns the xml representation for the inner text of the current node as a CDATA section.
|
||||
|
||||
Returns nothing if the provided name is neither a valid attribute name, nor a valid parameter name.
|
||||
19
lib/sd/manual/docs/api/simple_html_dom_node/__isset.md
Normal file
19
lib/sd/manual/docs/api/simple_html_dom_node/__isset.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# __isset
|
||||
|
||||
```php
|
||||
__isset ( string $name ) : bool
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `name` | `outertext`, `innertext`, `plaintext` or attribute name.
|
||||
|
||||
See [magic methods](http://php.net/manual/en/language.oop5.overloading.php#object.get)
|
||||
|
||||
Returns true if the provided name is a valid attribute name or any of the values in the table below. False otherwise.
|
||||
|
||||
| Name | Description
|
||||
| ---- | -----------
|
||||
| `outertext` | Returns the outer text of the current node.
|
||||
| `innertext` | Returns the inner text of the current node.
|
||||
| `plaintext` | Returns the plain text of the current node.
|
||||
18
lib/sd/manual/docs/api/simple_html_dom_node/__set.md
Normal file
18
lib/sd/manual/docs/api/simple_html_dom_node/__set.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# __set
|
||||
|
||||
```php
|
||||
__set ( string $name, mixed $value )
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `name` | `outertext`, `innertext` or attribute name.
|
||||
| `value` | Value to set.
|
||||
|
||||
See [magic methods](http://php.net/manual/en/language.oop5.overloading.php#object.get)
|
||||
|
||||
Sets the outer text of the current node to `$value` if `$name` is `outertext`.
|
||||
|
||||
Sets the inner text of the current node to `$value` if `$name` is `innertext`.
|
||||
|
||||
Otherwise, adds or updates an attribute with name `$name` and value `$value` to the current node.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# __toString
|
||||
|
||||
```php
|
||||
__toString ( ) : string
|
||||
```
|
||||
|
||||
Returns the outer text of the current node.
|
||||
7
lib/sd/manual/docs/api/simple_html_dom_node/__unset.md
Normal file
7
lib/sd/manual/docs/api/simple_html_dom_node/__unset.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# __unset
|
||||
|
||||
```php
|
||||
__unset ( string $name )
|
||||
```
|
||||
|
||||
Removes the attribute with name `$name` from the current node if it exists.
|
||||
23
lib/sd/manual/docs/api/simple_html_dom_node/addClass.md
Normal file
23
lib/sd/manual/docs/api/simple_html_dom_node/addClass.md
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# addClass
|
||||
|
||||
```php
|
||||
addClass ( mixed $class )
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `class` | Specifies one or more class names to be added.
|
||||
|
||||
Adds one or more class names to the current node.
|
||||
|
||||
**Remarks**
|
||||
|
||||
* To add more than one class, separate the class names with space or provide them as an array.
|
||||
|
||||
**Examples**
|
||||
|
||||
```php
|
||||
$node->addClass('hidden');
|
||||
$node->addClass('article important');
|
||||
$node->addClass(array('article', 'new'));
|
||||
```
|
||||
13
lib/sd/manual/docs/api/simple_html_dom_node/appendChild.md
Normal file
13
lib/sd/manual/docs/api/simple_html_dom_node/appendChild.md
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# appendChild
|
||||
|
||||
```php
|
||||
appendChild ( object $node ) : object
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `node` | An object of type [`simple_html_dom_node`](../simple_html_dom_node/)
|
||||
|
||||
Makes the current node parent of the node provided to this function.
|
||||
|
||||
Returns the provided node.
|
||||
15
lib/sd/manual/docs/api/simple_html_dom_node/childNodes.md
Normal file
15
lib/sd/manual/docs/api/simple_html_dom_node/childNodes.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# childNodes
|
||||
|
||||
```php
|
||||
childNodes ( [ int $idx = -1 ] ) : mixed
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `idx` | Index of the node to return or `-1` to return all nodes.
|
||||
|
||||
Returns all or one specific child node from the current node.
|
||||
|
||||
## Remarks
|
||||
|
||||
This function is a wrapper for [`children`](../children/)
|
||||
11
lib/sd/manual/docs/api/simple_html_dom_node/children.md
Normal file
11
lib/sd/manual/docs/api/simple_html_dom_node/children.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# children
|
||||
|
||||
```php
|
||||
children ( [ int $idx = -1 ] ) : mixed
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `idx` | Index of the node to return or `-1` to return all nodes.
|
||||
|
||||
Returns all or one specific child node from the current node.
|
||||
7
lib/sd/manual/docs/api/simple_html_dom_node/clear.md
Normal file
7
lib/sd/manual/docs/api/simple_html_dom_node/clear.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# clear
|
||||
|
||||
```php
|
||||
clear ( )
|
||||
```
|
||||
|
||||
Sets all properties in the current node, which contain objects, to null.
|
||||
13
lib/sd/manual/docs/api/simple_html_dom_node/convert_text.md
Normal file
13
lib/sd/manual/docs/api/simple_html_dom_node/convert_text.md
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# convert_text
|
||||
|
||||
```php
|
||||
convert_text ( string $text ) : string
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `text` | Text to convert.
|
||||
|
||||
Assumes that the provided text is in the form of the configured source character set (see [`sourceCharset`](../simple_html_dom_node/) and converts it to the specified target character set (see [`targetCharset`](../simple_html_dom_node/)).
|
||||
|
||||
Returns the converted text.
|
||||
12
lib/sd/manual/docs/api/simple_html_dom_node/dump.md
Normal file
12
lib/sd/manual/docs/api/simple_html_dom_node/dump.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# dump
|
||||
|
||||
```php
|
||||
dump ( [ bool $show_attr = false [, int $depth = 0 ]] )
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `show_attr` | Attribute names are included in the output if enabled.
|
||||
| `depth` | Depth of the current element
|
||||
|
||||
Dumps information about the current node and all child nodes recursively.
|
||||
11
lib/sd/manual/docs/api/simple_html_dom_node/dump_node.md
Normal file
11
lib/sd/manual/docs/api/simple_html_dom_node/dump_node.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# dump_node
|
||||
|
||||
```php
|
||||
dump_node ( [ bool $echo = true ] ) : mixed
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `echo` | Echoes the dump details directly if enabled.
|
||||
|
||||
Dumps information about the current document node. Returns a string if `$echo` is set to false, null otherwise.
|
||||
44
lib/sd/manual/docs/api/simple_html_dom_node/find.md
Normal file
44
lib/sd/manual/docs/api/simple_html_dom_node/find.md
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# find
|
||||
|
||||
```php
|
||||
find (
|
||||
string $selector
|
||||
[, int $idx = null ]
|
||||
[, bool $lowercase = false ]
|
||||
) : mixed
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `selector` | [CSS](https://www.w3.org/TR/selectors/) selector.
|
||||
| `idx` | Index of element to return.
|
||||
| `lowercase` | Matches tag names case insensitive (lowercase) if enabled.
|
||||
|
||||
Finds one or more nodes in the current document, using CSS selectors.
|
||||
|
||||
* Returns null if no match was found.
|
||||
* Returns an array of [`simple_html_dom_node`](../simple_html_dom_node/) if `$idx` is null.
|
||||
* Returns an object of type [`simple_html_dom_node`](../simple_html_dom_node/) if `$idx` is anything __but__ null.
|
||||
|
||||
## Supported Selectors
|
||||
|
||||
| Selector | Description
|
||||
| --------- | -----------
|
||||
| `*` | [Universal selector](https://www.w3.org/TR/selectors/#the-universal-selector)
|
||||
| `E` | [Type (tag name) selector](https://www.w3.org/TR/selectors/#type-selectors)
|
||||
| `E#id` | [ID selector](https://www.w3.org/TR/selectors/#id-selectors)
|
||||
| `E.class` | [Class selector](https://www.w3.org/TR/selectors/#class-html)
|
||||
| `E[attr]` | [Attribute selector](https://www.w3.org/TR/selectors/#attribute-selectors)
|
||||
| `E[attr="value"]` | [Attribute selector](https://www.w3.org/TR/selectors/#attribute-selectors)
|
||||
| `E[attr="value"] i` | [Case-sensitivity](https://www.w3.org/TR/selectors/#attribute-case)
|
||||
| `E[attr="value"] s` | [Case-sensitivity](https://www.w3.org/TR/selectors/#attribute-case)
|
||||
| `E[attr~="value"]` | [Attribute selector](https://www.w3.org/TR/selectors/#attribute-selectors)
|
||||
| `E[attr^="value"]` | [Substring matching attribute selector](https://www.w3.org/TR/selectors/#attribute-substrings)
|
||||
| `E[attr$="value"]` | [Substring matching attribute selector](https://www.w3.org/TR/selectors/#attribute-substrings)
|
||||
| `E[attr*="value"]` | [Substring matching attribute selector](https://www.w3.org/TR/selectors/#attribute-substrings)
|
||||
| `E[attr|="value"]` | [Attribute selector](https://www.w3.org/TR/selectors/#attribute-selectors)
|
||||
| `E F` | [Descendant combinator](https://www.w3.org/TR/selectors/#descendant-combinators)
|
||||
| `E > F` | [Child combinator](https://www.w3.org/TR/selectors/#child-combinators)
|
||||
| `E + F` | [Next-sibling combinator](https://www.w3.org/TR/selectors/#adjacent-sibling-combinators)
|
||||
| `E ~ F` | [Subsequent-sibling combinator](https://www.w3.org/TR/selectors/#general-sibling-combinators)
|
||||
| `E, F` | [Selector list](https://www.w3.org/TR/selectors/#selector-list)
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# find_ancestor_tag
|
||||
|
||||
```php
|
||||
find_ancestor_tag ( string $tag ) : object
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `tag` | Tag name of the element to find.
|
||||
|
||||
Returns the first matching node that matches the specified tag name or null if no match was found.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# firstChild
|
||||
|
||||
```php
|
||||
firstChild ( ) : mixed
|
||||
```
|
||||
|
||||
This function is a wrapper for [`first_child`](../first_child/)
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# first_child
|
||||
|
||||
```php
|
||||
first_child ( ) : mixed
|
||||
```
|
||||
|
||||
Returns the first child node of the current node or null if the current nod has no child nodes.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# getAllAttributes
|
||||
|
||||
```php
|
||||
getAllAttributes ( ) : array
|
||||
```
|
||||
|
||||
Returns all attributes for the current node.
|
||||
11
lib/sd/manual/docs/api/simple_html_dom_node/getAttribute.md
Normal file
11
lib/sd/manual/docs/api/simple_html_dom_node/getAttribute.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# getAttribute
|
||||
|
||||
```php
|
||||
getAttribute ( string $name ) : mixed
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `name` | Attribute name.
|
||||
|
||||
Returns the value for the attribute `$name`.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# getElementById
|
||||
|
||||
```php
|
||||
getElementById ( string $id ) : object
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `id` | Element id.
|
||||
|
||||
Returns the first element with the specified id.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# getElementByTagName
|
||||
|
||||
```php
|
||||
getElementByTagName ( string $name ) : object
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `name` | Tag name.
|
||||
|
||||
Returns the first element with the specified tag name.
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# getElementsById
|
||||
|
||||
```php
|
||||
getElementsById ( string $id [, int $idx = null] ) : mixed
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `id` | Element id.
|
||||
| `idx` | Index of element to return.
|
||||
|
||||
Returns all elements with the specified id if `$idx` is null, or a specific one if `$idx` is a valid index.
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# getElementsByTagName
|
||||
|
||||
```php
|
||||
getElementsByTagName ( string $name [, int $idx = null ] ) : mixed
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `name` | Tag name.
|
||||
| `idx` | Index of the element to return.
|
||||
|
||||
Returns all elements with the specified tag name if `$idx` is null, or a specific one if `$idx` is a valid index.
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# get_display_size
|
||||
|
||||
```php
|
||||
get_display_size ( ) : mixed
|
||||
```
|
||||
|
||||
Returns false if the current node is not an image.
|
||||
|
||||
Returns an associative array of two elements - `height` and `width` - that represent the display size of the image.
|
||||
11
lib/sd/manual/docs/api/simple_html_dom_node/hasAttribute.md
Normal file
11
lib/sd/manual/docs/api/simple_html_dom_node/hasAttribute.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# hasAttribute
|
||||
|
||||
```php
|
||||
hasAttribute ( string $name ) : bool
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `name` | Name of the attribute.
|
||||
|
||||
Returns true if the current node has an attribute with the specified name.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# hasChildNodes
|
||||
|
||||
```php
|
||||
hasChildNodes ( ) : bool
|
||||
```
|
||||
|
||||
This is a wrapper function for [`has_child`](../has_child/).
|
||||
17
lib/sd/manual/docs/api/simple_html_dom_node/hasClass.md
Normal file
17
lib/sd/manual/docs/api/simple_html_dom_node/hasClass.md
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# hasClass
|
||||
|
||||
```php
|
||||
hasClass ( string $class ) : bool
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `class` | Specifies the class name to search for.
|
||||
|
||||
Returns true if the current node has the specified class name.
|
||||
|
||||
**Examples**
|
||||
|
||||
```php
|
||||
$node->hasClass('article');
|
||||
```
|
||||
7
lib/sd/manual/docs/api/simple_html_dom_node/has_child.md
Normal file
7
lib/sd/manual/docs/api/simple_html_dom_node/has_child.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# has_child
|
||||
|
||||
```php
|
||||
has_child ( ) : bool
|
||||
```
|
||||
|
||||
Returns true if the current node has one or more child nodes.
|
||||
7
lib/sd/manual/docs/api/simple_html_dom_node/innertext.md
Normal file
7
lib/sd/manual/docs/api/simple_html_dom_node/innertext.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# innertext
|
||||
|
||||
```php
|
||||
innertext ( ) : string
|
||||
```
|
||||
|
||||
Returns the inner text (everything inside the opening and closing tags) of the current node.
|
||||
11
lib/sd/manual/docs/api/simple_html_dom_node/is_utf8.md
Normal file
11
lib/sd/manual/docs/api/simple_html_dom_node/is_utf8.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# is_utf8 (static)
|
||||
|
||||
```php
|
||||
is_utf8 ( string $str ) : bool
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `str` | String to test.
|
||||
|
||||
Returns true if the provided string is a valid UTF-8 string.
|
||||
7
lib/sd/manual/docs/api/simple_html_dom_node/lastChild.md
Normal file
7
lib/sd/manual/docs/api/simple_html_dom_node/lastChild.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# lastChild
|
||||
|
||||
```php
|
||||
lastChild ( ) : object
|
||||
```
|
||||
|
||||
This is a wrapper for [`last_child`](../last_child/).
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# last_child
|
||||
|
||||
```php
|
||||
last_child ( ) : object
|
||||
```
|
||||
|
||||
Returns the last child of the current node or null if the current node has no child elements.
|
||||
7
lib/sd/manual/docs/api/simple_html_dom_node/makeup.md
Normal file
7
lib/sd/manual/docs/api/simple_html_dom_node/makeup.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# makeup
|
||||
|
||||
```php
|
||||
makeup ( ) : string
|
||||
```
|
||||
|
||||
Returns the HTML representation of the current node.
|
||||
19
lib/sd/manual/docs/api/simple_html_dom_node/match.md
Normal file
19
lib/sd/manual/docs/api/simple_html_dom_node/match.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# match (protected)
|
||||
|
||||
```php
|
||||
match (
|
||||
string $exp
|
||||
, string $pattern
|
||||
, string $value
|
||||
, string $case_sensitivity
|
||||
) : bool
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `exp` | Expression
|
||||
| `pattern` | Pattern
|
||||
| `value` | Value
|
||||
| `case_sensitivity` | Case sensitivity
|
||||
|
||||
Matches a single attribute value against the specified attribute selector. See also [`find`](../find/).
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# nextSibling
|
||||
|
||||
```php
|
||||
nextSibling ( ) : object
|
||||
```
|
||||
|
||||
This is a wrapper for [`next_sibling`](../next_sibling/).
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# next_sibling
|
||||
|
||||
```php
|
||||
next_sibling ( ) : object
|
||||
```
|
||||
|
||||
Returns the next sibling of the current node or null if the current node has no next sibling.
|
||||
7
lib/sd/manual/docs/api/simple_html_dom_node/nodeName.md
Normal file
7
lib/sd/manual/docs/api/simple_html_dom_node/nodeName.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# nodeName
|
||||
|
||||
```php
|
||||
nodeName ( ) : string
|
||||
```
|
||||
|
||||
Returns the name of the current node (tag name).
|
||||
7
lib/sd/manual/docs/api/simple_html_dom_node/outertext.md
Normal file
7
lib/sd/manual/docs/api/simple_html_dom_node/outertext.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# outertext
|
||||
|
||||
```php
|
||||
outertext ( ) : string
|
||||
```
|
||||
|
||||
Returns the outer text (everything including the opening and closing tags) of the current node.
|
||||
12
lib/sd/manual/docs/api/simple_html_dom_node/parent.md
Normal file
12
lib/sd/manual/docs/api/simple_html_dom_node/parent.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# parent
|
||||
|
||||
```php
|
||||
parent ( [ object $parent = null ] ) : object
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `parent` | The parent node
|
||||
|
||||
* Returns the parent node of the current node if `$parent` is null.
|
||||
* Sets the parent node of the current node if `$parent` is not null. In this case the current node is automatically added to the list of nodes in the parent node.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# parentNode
|
||||
|
||||
```php
|
||||
parentNode () : object
|
||||
```
|
||||
|
||||
Returns the current's node parent.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# parse_selector (protected)
|
||||
|
||||
```php
|
||||
parse_selector ( string $selector_string ) : array
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `selector_string` | The selector string
|
||||
|
||||
Parses a CSS selector into an internal format for further use. See also [`find`](../find/).
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# prevSibling
|
||||
|
||||
```php
|
||||
prevSibling ( ) : object
|
||||
```
|
||||
|
||||
This is a wrapper for [`previous_sibling`](../previous_sibling/).
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# prev_sibling
|
||||
|
||||
```php
|
||||
prev_sibling ( ) : object
|
||||
```
|
||||
|
||||
Returns the previous sibling of the current node, or null if the current node has no previous sibling.
|
||||
39
lib/sd/manual/docs/api/simple_html_dom_node/remove.md
Normal file
39
lib/sd/manual/docs/api/simple_html_dom_node/remove.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# remove
|
||||
|
||||
```php
|
||||
remove ( )
|
||||
```
|
||||
|
||||
Removes the current node recursively from the DOM.
|
||||
Does nothing if the node has no parent (root node);
|
||||
|
||||
**Example**
|
||||
|
||||
```php
|
||||
$html = str_get_html(<<<EOD
|
||||
<html>
|
||||
<body>
|
||||
<table>
|
||||
<tr><th>Title</th></tr>
|
||||
<tr><td>Row 1</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
EOD
|
||||
);
|
||||
|
||||
$table = $html->find('table', 0);
|
||||
$table->remove();
|
||||
|
||||
echo $html;
|
||||
|
||||
/**
|
||||
* Returns
|
||||
*
|
||||
* <html> <body> </body> </html>
|
||||
*/
|
||||
```
|
||||
|
||||
**Remarks**
|
||||
|
||||
* Whitespace immediately **before** the removed node will remain in the DOM.
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# removeAttribute
|
||||
|
||||
```php
|
||||
removeAttribute ( string $name )
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `name` | Name of the attribute to remove.
|
||||
|
||||
Removes the attribute with the speicified name from the current node.
|
||||
43
lib/sd/manual/docs/api/simple_html_dom_node/removeChild.md
Normal file
43
lib/sd/manual/docs/api/simple_html_dom_node/removeChild.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# removeChild
|
||||
|
||||
```php
|
||||
removeChild ( object $node )
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `node` | Node to remove from current element, must be a child of the current element.
|
||||
|
||||
Removes the node recursively from the DOM.
|
||||
Does nothing if the provided node is not a child of the current node.
|
||||
|
||||
**Example**
|
||||
|
||||
```php
|
||||
$html = str_get_html(<<<EOD
|
||||
<html>
|
||||
<body>
|
||||
<table>
|
||||
<tr><th>Title</th></tr>
|
||||
<tr><td>Row 1</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
EOD
|
||||
);
|
||||
|
||||
$body = $html->find('body', 0);
|
||||
$body->removeChild($body->find('table', 0));
|
||||
|
||||
echo $html;
|
||||
|
||||
/**
|
||||
* Returns
|
||||
*
|
||||
* <html> <body> </body> </html>
|
||||
*/
|
||||
```
|
||||
|
||||
**Remarks**
|
||||
|
||||
* Whitespace immediately **before** the removed node will remain in the DOM.
|
||||
25
lib/sd/manual/docs/api/simple_html_dom_node/removeClass.md
Normal file
25
lib/sd/manual/docs/api/simple_html_dom_node/removeClass.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# removeClass
|
||||
|
||||
```php
|
||||
removeClass ( [ mixed $class = null ] )
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `class` | Specifies one or more class names to be removed.
|
||||
|
||||
Removes one or more class names from the current node.
|
||||
|
||||
**Remarks**
|
||||
|
||||
* To remove more than one class, separate the class names with space or provide them as an array.
|
||||
* If no parameter is specified, this method will remove all class names from the current node.
|
||||
|
||||
**Examples**
|
||||
|
||||
```php
|
||||
$node->removeClass('hidden');
|
||||
$node->removeClass('article important');
|
||||
$node->removeClass(array('article', 'new'));
|
||||
$node->removeClass();
|
||||
```
|
||||
20
lib/sd/manual/docs/api/simple_html_dom_node/save.md
Normal file
20
lib/sd/manual/docs/api/simple_html_dom_node/save.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# save
|
||||
|
||||
```php
|
||||
save ( [ string $filepath = '' ] ) : string
|
||||
```
|
||||
|
||||
Writes the current node to file.
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `filepath` | Writes to file if the provided file path is not empty.
|
||||
|
||||
Returns the document string.
|
||||
|
||||
**Examples**
|
||||
|
||||
```php
|
||||
$string = $node->save();
|
||||
$string = $node->save($file);
|
||||
```
|
||||
19
lib/sd/manual/docs/api/simple_html_dom_node/seek.md
Normal file
19
lib/sd/manual/docs/api/simple_html_dom_node/seek.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# seek (protected)
|
||||
|
||||
```php
|
||||
seek (
|
||||
string $selector
|
||||
, array &$ret
|
||||
, string $parent_cmd
|
||||
[, bool $lowercase = false ]
|
||||
)
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `selector` | The current selector.
|
||||
| `ret` | Previous return value (starting point).
|
||||
| `parent_cmd` | The combinator used before the current selector.
|
||||
| `lowercase` | Matches tag names case insensitive (lowercase) if enabled.
|
||||
|
||||
Starts by searching for child elements of `$ret` that match the specified selector. Adds matching elements to `$ret` (for the next iteration).
|
||||
12
lib/sd/manual/docs/api/simple_html_dom_node/setAttribute.md
Normal file
12
lib/sd/manual/docs/api/simple_html_dom_node/setAttribute.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# setAttribute
|
||||
|
||||
```php
|
||||
setAttribute ( string $name, string $value )
|
||||
```
|
||||
|
||||
| Parameter | Description
|
||||
| --------- | -----------
|
||||
| `name` | Attribute name
|
||||
| `value` | Attribute value
|
||||
|
||||
Adds or sets an attribute in the current node to the specified value.
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
title: simple_html_dom_node
|
||||
---
|
||||
|
||||
# simple_html_dom_node
|
||||
|
||||
Represents a single node in the DOM tree (see [`simple_html_dom`](../../simple_html_dom/simple_html_dom/)).
|
||||
|
||||
# Public Properties
|
||||
|
||||
| Property | Description
|
||||
| -------- | -----------
|
||||
| `_` | Node meta data (i.e. type of node).
|
||||
| `attr` | List of attributes.
|
||||
| `children` | List of child nodes.
|
||||
| `nodes` | List of nodes.
|
||||
| `nodetype` | Node type.
|
||||
| `parent` | Parent node object.
|
||||
| `tag` | Node's tag name.
|
||||
| `tag_start` | Start position of the tag name in the original document.
|
||||
|
||||
# Protected Properties
|
||||
|
||||
None.
|
||||
|
||||
# Private Properties
|
||||
|
||||
| Property | Description
|
||||
| -------- | -----------
|
||||
| `dom` | The DOM object (see [`simple_html_dom`](../../simple_html_dom/simple_html_dom/)).
|
||||
7
lib/sd/manual/docs/api/simple_html_dom_node/text.md
Normal file
7
lib/sd/manual/docs/api/simple_html_dom_node/text.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# text
|
||||
|
||||
```php
|
||||
text ( ) : string
|
||||
```
|
||||
|
||||
Returns the (HTML) text representation for the current node recursively.
|
||||
7
lib/sd/manual/docs/api/simple_html_dom_node/xmltext.md
Normal file
7
lib/sd/manual/docs/api/simple_html_dom_node/xmltext.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# xmltext
|
||||
|
||||
```php
|
||||
xmltext ( ) : string
|
||||
```
|
||||
|
||||
Returns the xml representation for the inner text of the current node as a CDATA section.
|
||||
Loading…
Add table
Add a link
Reference in a new issue