PHP Interface pQuery\IQuery

Inheritance: extends Countable
显示文件 Open project: tburry/pquery

Public Methods

Method Description
addClass ( string $classname ) : pquery\IQuery Adds the specified class(es) to each of the set of matched elements.
after ( string $content ) : pquery\IQuery Insert content, specified by the parameter, after each element in the set of matched elements.
append ( string $content ) : pquery\IQuery Insert content, specified by the parameter, to the end of each element in the set of matched elements.
attr ( string $name, null | string $value = null ) : string | pquery\IQuery Get the value of an attribute for the first element in the set of matched elements or set one or more attributes for every matched element.
before ( string $content ) : pquery\IQuery Insert content, specified by the parameter, before each element in the set of matched elements.
clear ( ) : IQuery; Remove all child nodes of the set of matched elements from the DOM.
hasClass ( string $classname ) Determine whether any of the matched elements are assigned the given class.
html ( string | null $value = null ) Get the HTML contents of the first element in the set of matched elements or set the HTML contents of every matched element.
prepend ( string $content ) Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
prop ( string $name, null | string $value = null ) Get the value of a property for the first element in the set of matched elements or set one or more properties for every matched element.
remove ( null | string $selector = null ) Remove the set of matched elements from the DOM.
removeAttr ( string $name ) Remove an attribute from each element in the set of matched elements.
removeClass ( string $classname ) Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
replaceWith ( string $content ) Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
tagName ( $value = null ) Returns the name of the element.
text ( null | string $value = null ) Get the combined text contents of each element in the set of matched elements, including their descendants, or set the text contents of the matched elements.
toggleClass ( string $classname, $switch = null ) Add or remove one or more classes from each element in the set of matched elements, depending on either the class’s presence or the value of the switch argument.
unwrap ( ) Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
val ( string | null $value = null ) Get the current value of the first element in the set of matched elements or set the value of every matched element.
wrap ( $wrapping_element ) Wrap an HTML structure around each element in the set of matched elements.
wrapInner ( $wrapping_element ) Wrap an HTML structure around the content of each element in the set of matched elements.

Method Details

addClass() public method

Adds the specified class(es) to each of the set of matched elements.
public addClass ( string $classname ) : pquery\IQuery
$classname string The name of the class to add. You can add multiple classes by separating them with spaces.
return pquery\IQuery

after() public method

Insert content, specified by the parameter, after each element in the set of matched elements.
public after ( string $content ) : pquery\IQuery
$content string The content to add.
return pquery\IQuery

append() public method

Insert content, specified by the parameter, to the end of each element in the set of matched elements.
public append ( string $content ) : pquery\IQuery
$content string The content to append.
return pquery\IQuery

attr() public method

Get the value of an attribute for the first element in the set of matched elements or set one or more attributes for every matched element.
public attr ( string $name, null | string $value = null ) : string | pquery\IQuery
$name string The name of the attribute.
$value null | string The value to set or null to get the current attribute value.
return string | pquery\IQuery

before() public method

Insert content, specified by the parameter, before each element in the set of matched elements.
public before ( string $content ) : pquery\IQuery
$content string The content to add.
return pquery\IQuery

clear() public method

Remove all child nodes of the set of matched elements from the DOM.
public clear ( ) : IQuery;
return IQuery;

hasClass() public method

Determine whether any of the matched elements are assigned the given class.
public hasClass ( string $classname )
$classname string The name of the class to check.

html() public method

Get the HTML contents of the first element in the set of matched elements or set the HTML contents of every matched element.
public html ( string | null $value = null )
$value string | null The value to set.

prepend() public method

Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
public prepend ( string $content )
$content string The content to add.

prop() public method

Get the value of a property for the first element in the set of matched elements or set one or more properties for every matched element.
public prop ( string $name, null | string $value = null )
$name string The name of the property. The currently supported properties are `tagname`, `selected`, and `checked`.
$value null | string The value to set or null to get the current property value.

remove() public method

Remove the set of matched elements from the DOM.
public remove ( null | string $selector = null )
$selector null | string A css query to filter the set of removed nodes.

removeAttr() public method

Remove an attribute from each element in the set of matched elements.
public removeAttr ( string $name )
$name string The name of the attribute to remove.

removeClass() public method

Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
public removeClass ( string $classname )
$classname string The name of the class to remove.

replaceWith() public method

Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
public replaceWith ( string $content )
$content string The content that will replace the nodes.

tagName() public method

Returns the name of the element.
public tagName ( $value = null )

text() public method

Get the combined text contents of each element in the set of matched elements, including their descendants, or set the text contents of the matched elements.
public text ( null | string $value = null )
$value null | string A string to set the text or null to return the current text.

toggleClass() public method

Add or remove one or more classes from each element in the set of matched elements, depending on either the class’s presence or the value of the switch argument.
public toggleClass ( string $classname, $switch = null )
$classname string

unwrap() public method

Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
public unwrap ( )

val() public method

Get the current value of the first element in the set of matched elements or set the value of every matched element.
public val ( string | null $value = null )
$value string | null The new value of the element or null to return the current value.

wrap() public method

Wrap an HTML structure around each element in the set of matched elements.
public wrap ( $wrapping_element )

wrapInner() public method

Wrap an HTML structure around the content of each element in the set of matched elements.
public wrapInner ( $wrapping_element )