phpQuery

# Class: phpQueryObject

Source Location: /phpQueryObject.php

### Class Overview

Class representing phpQuery objects.

#### Author(s):

- Tobiasz Cudnik <tobiasz.cudnik/gmail.com>

Implements interfaces:

- Iterator (internal interface)
- Countable (internal interface)
- ArrayAccess (internal interface)

### Variables

- $charset
- $current
- $document
- $documentFragment
- $documentID
- $documentWrapper
- $elements
- $elementsBackup
- $elementsInterator
- $previous
- $root
- $valid
- $xpath

### Methods

- __construct
- add
- addClass
- addClassPHP
- after
- afterPHP
- ancestors
- andSelf
- append
- appendPHP
- appendTo
- attr
- attrAppend
- attrEvents
- attrPHP
- attrPrepend
- before
- beforePHP
- bind
- change
- children
- click
- contents
- contentsUnwrap
- count
- css
- current
- debug
- documentFragment
- dump
- dumpDie
- dumpLength
- dumpTree
- dumpWhois
- each
- elementsContainsNode
- end
- eq
- extend
- filter
- filterCallback
- find
- get
- getDocument
- getDocumentID
- getDocumentIDRef
- getDOMDocument
- getElementSiblings
- getNodeAttrs
- getNodeXpath
- getString
- getStrings
- hasClass
- hide
- html
- htmlOuter
- index
- insert
- insertAfter
- insertBefore
- is
- isChar
- isHTML
- isRegexp
- isRoot
- isXHTML
- isXML
- key
- length
- load
- map
- markup
- markupEvents
- markupOuter
- matchClasses
- merge
- newInstance
- next
- nextAll
- not
- offsetExists
- offsetGet
- offsetSet
- offsetUnset
- parent
- parents
- parseSelector
- php
- plugin
- prepend
- prependPHP
- prependTo
- prev
- prevAll
- pseudoClasses
- remove
- removeAttr
- removeClass
- replaceAll
- replaceWith
- replaceWithPHP
- reverse
- rewind
- runQuery
- serialize
- serializeArray
- show
- siblings
- size
- slice
- stack
- stackIsRoot
- submit
- switchWith
- text
- toggleClass
- toReference
- toRoot
- trigger
- triggerHandler
- unbind
- unloadDocument
- unQuote
- val
- valid
- whois
- wrap
- wrapAll
- wrapAllOld
- wrapAllPHP
- wrapInner
- wrapInnerPHP
- wrapPHP
- xml
- xmlOuter
- _clone
- _empty
- _next
- _prev
- __call
- __get
- __loadSuccess
- __pseudoClassParam
- __toString
- ___wrapAllCallback

### Class Details

[line 13]
Class representing phpQuery objects.

#### Tags:

method: | phpQueryObject clone(): clone()
method: | phpQueryObject empty(): empty()
method: | phpQueryObject next(): next($selector = null)
method: | phpQueryObject prev(): prev($selector = null)
author: | Tobiasz Cudnik <tobiasz.cudnik/gmail.com>

[ Top ]

### Class Variables

#### $charset = null

[line 22]

#### Tags:

access: | public

Type: | mixed

[ Top ]

#### $current = null

[line 77]

Iterator interface helper

#### Tags:

access: | protected

Type: | mixed

[ Top ]

#### $document = null

[line 21]

DOMDocument class.

#### Tags:

access: | public

Type: | DOMDocument

[ Top ]

#### $documentFragment = true

[line 62]

Indicated if doument is just a fragment (no <html> tag).

Every document is realy a full document, so even documentFragments can be queried against <html>, but getDocument(id)->htmlOuter() will return only contents of <body>.

#### Tags:

access: | public

Type: | bool

[ Top ]

#### $documentID = null

[line 15]

#### Tags:

access: | public

Type: | mixed

[ Top ]

#### $documentWrapper = null

[line 27]

#### Tags:

access: | public

Type: | DOMDocumentWrapper

[ Top ]

#### $elements = array()

[line 39]

Stack of selected elements.

#### Tags:

TODO: | refactor to ->nodes
access: | public

Type: | array

[ Top ]

#### $elementsBackup = array()

[line 43]

#### Tags:

access: | protected

Type: | mixed

[ Top ]

#### $elementsInterator = array()

[line 67]

Iterator interface helper

#### Tags:

access: | protected

Type: | mixed

[ Top ]

#### $previous = null

[line 47]

#### Tags:

access: | protected

Type: | mixed

[ Top ]

#### $root = array()

[line 52]

#### Tags:

TODO: | deprecate
access: | protected

Type: | mixed

[ Top ]

#### $valid = false

[line 72]

Iterator interface helper

#### Tags:

access: | protected

Type: | mixed

[ Top ]

#### $xpath = null

[line 33]

XPath interface.

#### Tags:

access: | public

Type: | DOMXPath

[ Top ]

### Class Methods

### static method extend [line 2254]

`static unknown_type extend( $class $class, [$file $file = null])`

Deprecated, use $pq->plugin() instead.

#### Tags:

deprecated: |
access: | public

#### Parameters:

$class | $class |
$file | $file |

[ Top ]

### static method unQuote [line 1296]

`static unknown_type unQuote( $value $value)`

#### Tags:

TODO: | implement in all methods using passed parameters
access: | protected

#### Parameters:

$value | $value |

[ Top ]

### constructor __construct [line 83]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery __construct( $documentID)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $documentID |

[ Top ]

### method add [line 2426]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery add( [string|phpQueryObject $selector = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

string|phpQueryObject | $selector |

[ Top ]

### method addClass [line 2757]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery addClass( $className)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $className |

[ Top ]

### method addClassPHP [line 2775]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery addClassPHP( $className)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $className |

[ Top ]

### method after [line 1984]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery after( $content)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $content |

[ Top ]

### method afterPHP [line 1992]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery afterPHP( $content)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $content |

[ Top ]

### method ancestors [line 1898]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery ancestors( [ $selector = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $selector |

[ Top ]

### method andSelf [line 2746]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery andSelf( )`

Enter description here...

#### Tags:

access: | public

[ Top ]

### method append [line 1907]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery append( $content)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $content |

[ Top ]

### method appendPHP [line 1915]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery appendPHP( $content)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $content |

[ Top ]

### method appendTo [line 1923]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery appendTo( $seletor)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $seletor |

[ Top ]

### method attr [line 2574]

`void attr( [ $attr = null], [ $value = null])`

#### Tags:

access: | public

#### Parameters:

| $attr |
| $value |

[ Top ]

### method attrAppend [line 2626]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery attrAppend( string $attr, mixed $value)`

Enter description here...

jQuery difference.

#### Tags:

todo: | use attr() function (encoding issues etc).
access: | public

#### Parameters:

string | $attr |
mixed | $value |

[ Top ]

### method attrEvents [line 2525]

`void attrEvents( $attr, $oldAttr, $oldValue, $node)`

#### Tags:

access: | protected

#### Parameters:

| $attr |
| $oldAttr |
| $oldValue |
| $node |

[ Top ]

### method attrPHP [line 2648]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery attrPHP( $attr, $value)`

Enter description here...

#### Tags:

todo: | check CDATA ???
access: | public

#### Parameters:

| $attr |
| $value |

[ Top ]

### method attrPrepend [line 2609]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery attrPrepend( string $attr, mixed $value)`

Enter description here...

jQuery difference.

#### Tags:

todo: | use attr() function (encoding issues etc).
access: | public

#### Parameters:

string | $attr |
mixed | $value |

[ Top ]

### method before [line 1958]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery before( $content)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $content |

[ Top ]

### method beforePHP [line 1966]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery beforePHP( $content)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $content |

[ Top ]

### method bind [line 1410]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery bind( unknown_type $type, unknown_type $data, [unknown_type $callback = null])`

Binds a handler to one or more events (like click) for each matched element.

Can also bind custom events.

#### Tags:

TODO: | support more than event in $type (space-separated)
TODO: | support '!' (exclusive) events
access: | public

#### Parameters:

unknown_type | $type |
unknown_type | $data | Optional
unknown_type | $callback |

[ Top ]

### method change [line 1439]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery change( [ $callback = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $callback |

[ Top ]

### method children [line 1874]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery children( [ $selector = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $selector |

[ Top ]

### method click [line 1459]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery click( [ $callback = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $callback |

[ Top ]

### method contents [line 1581]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery contents( )`

Enter description here...

#### Tags:

access: | public

[ Top ]

### method contentsUnwrap [line 1600]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery contentsUnwrap( )`

Enter description here...

jQuery difference.

#### Tags:

access: | public

[ Top ]

### method count [line 1658]

`void count( )`

#### Tags:

access: | public

Implementation of:

Countable::count

[ Top ]

### method css [line 1355]

`phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery css( )`

Enter description here...

#### Tags:

todo: |
access: | public

[ Top ]

### method current [line 2935]

`void current( )`

#### Tags:

access: | public

Implementation of:

Iterator::current

[ Top ]

### method debug [line 271]

`void debug( $in)`

#### Tags:

access: | protected

#### Parameters:

| $in |

[ Top ]

### method documentFragment [line 128]

`void documentFragment( [ $state = null])`

#### Tags:

access: | public

#### Parameters:

| $state |

[ Top ]

### method dump [line 3076]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery dump( )`

Dump htmlOuter and preserve chain. Usefull for debugging.

#### Tags:

access: | public

[ Top ]

### method dumpDie [line 3123]

`void dumpDie( )`

Dump htmlOuter and stop script execution. Usefull for debugging.

#### Tags:

access: | public

[ Top ]

### method dumpLength [line 3093]

`void dumpLength( )`

#### Tags:

access: | public

[ Top ]

### method dumpTree [line 3102]

`void dumpTree( )`

#### Tags:

access: | public

[ Top ]

### method dumpWhois [line 3084]

`void dumpWhois( )`

#### Tags:

access: | public

[ Top ]

### method each [line 2880]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery each( array|string $callback, [ $param1 = null], [ $param2 = null], [ $param3 = null], array $scope, array $arg1, array $arg2)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

array|string | $callback | Expects $node as first param, $index as second
array | $scope | External variables passed to callback. Use compact('varName1', 'varName2'...) and extract($scope)
array | $arg1 | Will ba passed as third and futher args to callback.
array | $arg2 | Will ba passed as fourth and futher args to callback, and so on...
| $param1 |
| $param2 |
| $param3 |

[ Top ]

### method elementsContainsNode [line 2448]

`void elementsContainsNode( $nodeToCheck, [ $elementsStack = null])`

#### Tags:

access: | protected

#### Parameters:

| $nodeToCheck |
| $elementsStack |

[ Top ]

### method end [line 1668]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery end( [ $level = 1])`

Enter description here...

#### Tags:

todo: | $level
access: | public

#### Parameters:

| $level |

[ Top ]

### method eq [line 1631]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery eq( $num)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $num |

[ Top ]

### method filter [line 1163]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery filter( $selectors, [ $_skipHistory = false])`

Enter description here...

#### Tags:

link: | http://docs.jquery.com/Traversing/filter
access: | public

#### Parameters:

| $selectors |
| $_skipHistory |

[ Top ]

### method filterCallback [line 1142]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery filterCallback( $callback, [ $_skipHistory = false])`

Enter description here...

jQuery difference.

#### Tags:

link: | http://docs.jquery.com/Traversing/filter
access: | public

#### Parameters:

| $callback |
| $_skipHistory |

[ Top ]

### method find [line 682]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery find( $selectors, [ $context = null], [ $noHistory = false])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $selectors |
| $context |
| $noHistory |

[ Top ]

### method get [line 476]

`array|DOMElement get( [int $index = null], [ $callback1 = null], [ $callback2 = null], [ $callback3 = null])`

Return matched DOM nodes.

#### Tags:

return: | Single DOMElement or array of DOMElement.
access: | public

#### Parameters:

int | $index |
| $callback1 |
| $callback2 |
| $callback3 |

[ Top ]

### method getDocument [line 186]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery getDocument( )`

Returns object with stack set to document root.

#### Tags:

access: | public

[ Top ]

### method getDocumentID [line 201]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery getDocumentID( )`

Get object's Document ID.

#### Tags:

access: | public

[ Top ]

### method getDocumentIDRef [line 177]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery getDocumentIDRef( &$documentID, unknown_type $domId)`

Saves object's DocumentID to $var by reference.

1. $myDocumentId;
2. phpQuery :: newDocument ('<div/>')
3. -> getDocumentIDRef ($myDocumentId)
4. -> find ('div')->...

#### Tags:

see: | phpQuery::newDocument
see: | phpQuery::newDocumentFile
access: | public

#### Parameters:

unknown_type | $domId |
| &$documentID |

[ Top ]

### method getDOMDocument [line 193]

`DOMDocument getDOMDocument( )`

#### Tags:

access: | public

[ Top ]

### method getElementSiblings [line 2340]

`void getElementSiblings( $direction, [ $selector = null], [ $limitToOne = false])`

#### Tags:

access: | protected

#### Parameters:

| $direction |
| $selector |
| $limitToOne |

[ Top ]

### method getNodeAttrs [line 2636]

`void getNodeAttrs( $node)`

#### Tags:

access: | protected

#### Parameters:

| $node |

[ Top ]

### method getNodeXpath [line 3012]

`string getNodeXpath( [unknown_type $oneNode = null], [ $namespace = null])`

Returns node's XPath.

#### Tags:

TODO: | use native getNodePath is avaible
access: | protected

#### Parameters:

unknown_type | $oneNode |
| $namespace |

[ Top ]

### method getString [line 502]

`array|string getString( [int $index = null], [ $callback1 = null], [ $callback2 = null], [ $callback3 = null])`

Return matched DOM nodes.

jQuery difference.

#### Tags:

return: | Returns string if $index != null
todo: | implement callbacks
todo: | return only arrays ?
todo: | maybe other name...
access: | public

#### Parameters:

int | $index |
| $callback1 |
| $callback2 |
| $callback3 |

[ Top ]

### method getStrings [line 529]

`array|string getStrings( [int $index = null], [ $callback1 = null], [ $callback2 = null], [ $callback3 = null])`

Return matched DOM nodes.

jQuery difference.

#### Tags:

return: | Returns string if $index != null
todo: | implement callbacks
todo: | return only arrays ?
todo: | maybe other name...
access: | public

#### Parameters:

int | $index |
| $callback1 |
| $callback2 |
| $callback3 |

[ Top ]

### method hasClass [line 2804]

`bool hasClass( string $className)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

string | $className |

[ Top ]

### method hide [line 1371]

`void hide( )`

#### Tags:

todo: |
access: | public

[ Top ]

### method html [line 1794]

`string|phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery html( [unknown_type $html = null], [ $callback1 = null], [ $callback2 = null], [ $callback3 = null])`

Enter description here...

#### Tags:

TODO: | force html result
access: | public

#### Parameters:

unknown_type | $html |
| $callback1 |
| $callback2 |
| $callback3 |

[ Top ]

### method htmlOuter [line 1837]

`String htmlOuter( [ $callback1 = null], [ $callback2 = null], [ $callback3 = null])`

Enter description here...

#### Tags:

TODO: | force html result
access: | public

#### Parameters:

| $callback1 |
| $callback2 |
| $callback3 |

[ Top ]

### method index [line 2168]

`Int index( $subject)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $subject |

[ Top ]

### method insert [line 2012]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery insert( unknown_type $target, unknown_type $type)`

Various insert scenarios.

#### Tags:

access: | protected

#### Parameters:

unknown_type | $target |
unknown_type | $type |

[ Top ]

### method insertAfter [line 2000]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery insertAfter( $seletor)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $seletor |

[ Top ]

### method insertBefore [line 1975]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery insertBefore( String|phpQuery $seletor)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

String|phpQuery | $seletor |

[ Top ]

### method is [line 1117]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery is( $selector, [ $nodes = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $selector |
| $nodes |

[ Top ]

### method isChar [line 300]

`bool isChar( string $char)`

Determines if $char is really a char.

#### Tags:

todo: | rewrite me to charcode range ! ;)
access: | protected

#### Parameters:

string | $char |

[ Top ]

### method isHTML [line 214]

`void isHTML( )`

#### Tags:

access: | public

[ Top ]

### method isRegexp [line 286]

`void isRegexp( $pattern)`

#### Tags:

access: | protected

#### Parameters:

| $pattern |

[ Top ]

### method isRoot [line 139]

`void isRoot( $node)`

#### Tags:

TODO: | documentWrapper
access: | protected

#### Parameters:

| $node |

[ Top ]

### method isXHTML [line 217]

`void isXHTML( )`

#### Tags:

access: | public

[ Top ]

### method isXML [line 220]

`void isXML( )`

#### Tags:

access: | public

[ Top ]

### method key [line 2941]

`void key( )`

#### Tags:

access: | public

Implementation of:

Iterator::key

[ Top ]

### method length [line 1655]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery length( )`

Enter description here...

#### Tags:

deprecated: | Use length as attribute
access: | public

[ Top ]

### method load [line 1308]

`phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery load( $url, [ $data = null], [ $callback = null])`

Enter description here...

#### Tags:

link: | http://docs.jquery.com/Ajax/load
todo: | Support $selector
access: | public

#### Parameters:

| $url |
| $data |
| $callback |

[ Top ]

### method map [line 2897]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery map( $callback, [ $param1 = null], [ $param2 = null], [ $param3 = null])`

Enter description here...

#### Tags:

todo: | add $scope and $args as in each() ???
access: | public

#### Parameters:

| $callback |
| $param1 |
| $param2 |
| $param3 |

[ Top ]

### method markup [line 1767]

`unknown_type markup( [$markup $markup = null], [ $callback1 = null], [ $callback2 = null], [ $callback3 = null])`

jQuey difference

#### Tags:

TODO: | trigger change event for textarea
access: | public

#### Parameters:

$markup | $markup |
| $callback1 |
| $callback2 |
| $callback3 |

[ Top ]

### method markupEvents [line 1749]

`void markupEvents( $newMarkup, $oldMarkup, $node)`

#### Tags:

access: | protected

#### Parameters:

| $newMarkup |
| $oldMarkup |
| $node |

[ Top ]

### method markupOuter [line 1780]

`unknown_type markupOuter( [$markup $callback1 = null], [ $callback2 = null], [ $callback3 = null])`

jQuey difference

#### Tags:

access: | public

#### Parameters:

$markup | $callback1 |
| $callback2 |
| $callback3 |

[ Top ]

### method matchClasses [line 582]

`boolean matchClasses( unknown_type $class, unknown_type $node)`

Enter description here...

In the future, when PHP will support XLS 2.0, then we would do that this way: contains(tokenize(@class, '\s'), "something")

#### Tags:

access: | protected

#### Parameters:

unknown_type | $class |
unknown_type | $node |

[ Top ]

### method merge [line 2438]

`void merge( )`

#### Tags:

access: | protected

[ Top ]

### method newInstance [line 555]

`void newInstance( [array $newStack = null])`

Returns new instance of actual class.

#### Tags:

access: | public

#### Parameters:

array | $newStack | Optional. Will replace old stack with new and move old one to history.c

[ Top ]

### method next [line 2955]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery next( [ $cssSelector = null])`

Double-function method.

First: main iterator interface method. Second: Returning next sibling, alias for _next().

Proper functionality is choosed automagicaly.

#### Tags:

see: | phpQueryObject::_next()
access: | public

Implementation of:

Iterator::next

#### Parameters:

| $cssSelector |

[ Top ]

### method nextAll [line 2332]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery nextAll( [ $selector = null])`

#### Tags:

todo: | FIXME: returns source elements insted of next siblings
access: | public

#### Parameters:

| $selector |

[ Top ]

### method not [line 2386]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery not( [ $selector = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $selector |

[ Top ]

### method offsetExists [line 2980]

`void offsetExists( $offset)`

#### Tags:

access: | public

Implementation of:

ArrayAccess::offsetExists

#### Parameters:

| $offset |

[ Top ]

### method offsetGet [line 2986]

`void offsetGet( $offset)`

#### Tags:

access: | public

Implementation of:

ArrayAccess::offsetGet

#### Parameters:

| $offset |

[ Top ]

### method offsetSet [line 2992]

`void offsetSet( $offset, $value)`

#### Tags:

access: | public

Implementation of:

ArrayAccess::offsetSet

#### Parameters:

| $offset |
| $value |

[ Top ]

### method offsetUnset [line 2999]

`void offsetUnset( $offset)`

#### Tags:

access: | public

Implementation of:

ArrayAccess::offsetUnset

#### Parameters:

| $offset |

[ Top ]

### method parent [line 2464]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery parent( [ $selector = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $selector |

[ Top ]

### method parents [line 2481]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery parents( [ $selector = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $selector |

[ Top ]

### method parseSelector [line 308]

`void parseSelector( $query)`

#### Tags:

access: | protected

#### Parameters:

| $query |

[ Top ]

### method php [line 1862]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery php( [ $code = null])`

Just like html(), but returns markup with VALID (dangerous) PHP tags.

#### Tags:

todo: | support returning markup with PHP tags when called without param
access: | public

#### Parameters:

| $code |

[ Top ]

### method plugin [line 2242]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery plugin( $class, [ $file = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $class |
| $file |

[ Top ]

### method prepend [line 1932]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery prepend( $content)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $content |

[ Top ]

### method prependPHP [line 1941]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery prependPHP( $content)`

Enter description here...

#### Tags:

todo: | accept many arguments, which are joined, arrays maybe also
access: | public

#### Parameters:

| $content |

[ Top ]

### method prependTo [line 1949]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery prependTo( $seletor)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $seletor |

[ Top ]

### method prev [line 2312]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery prev( [ $selector = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $selector |

[ Top ]

### method prevAll [line 2322]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery prevAll( [ $selector = null])`

#### Tags:

todo: |
access: | public

#### Parameters:

| $selector |

[ Top ]

### method pseudoClasses [line 843]

`void pseudoClasses( $class)`

#### Tags:

todo: | create API for classes with pseudoselectors
access: | protected

#### Parameters:

| $class |

[ Top ]

### method remove [line 1736]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery remove( [ $selector = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $selector |

[ Top ]

### method removeAttr [line 2679]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery removeAttr( $attr)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $attr |

[ Top ]

### method removeClass [line 2817]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery removeClass( $className)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $className |

[ Top ]

### method replaceAll [line 1723]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery replaceAll( String $selector)`

Enter description here...

#### Tags:

todo: | this works ?
access: | public

#### Parameters:

String | $selector |

[ Top ]

### method replaceWith [line 1712]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery replaceWith( String|phpQuery $content)`

Enter description here...

#### Tags:

link: | http://docs.jquery.com/Manipulation/replaceWith#content
access: | public

#### Parameters:

String|phpQuery | $content |

[ Top ]

### method replaceWithPHP [line 1701]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery replaceWithPHP( $code)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $code |

[ Top ]

### method reverse [line 2210]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery reverse( )`

Enter description here...

#### Tags:

access: | public

[ Top ]

### method rewind [line 2920]

`void rewind( )`

#### Tags:

access: | public

Implementation of:

Iterator::rewind

[ Top ]

### method runQuery [line 612]

`void runQuery( $XQuery, [ $selector = null], [ $compare = null])`

#### Tags:

access: | protected

#### Parameters:

| $XQuery |
| $selector |
| $compare |

[ Top ]

### method serialize [line 229]

`string serialize( )`

Enter description here...

#### Tags:

link: | http://docs.jquery.com/Ajax/serialize
access: | public

[ Top ]

### method serializeArray [line 239]

`array serializeArray( [ $submit = null])`

Enter description here...

#### Tags:

link: | http://docs.jquery.com/Ajax/serializeArray
access: | public

#### Parameters:

| $submit |

[ Top ]

### method show [line 1363]

`void show( )`

#### Tags:

todo: |
access: | public

[ Top ]

### method siblings [line 2368]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery siblings( [ $selector = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $selector |

[ Top ]

### method size [line 1645]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery size( )`

Enter description here...

#### Tags:

access: | public

[ Top ]

### method slice [line 2189]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery slice( unknown_type $start, [unknown_type $end = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

unknown_type | $start |
unknown_type | $end |

[ Top ]

### method stack [line 2513]

`string|array|phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery stack( [ $nodeTypes = null], unknown_type $attr, unknown_type $value)`

Attribute method.

Accepts * for all attributes (for setting and getting)

#### Tags:

access: | protected

#### Parameters:

unknown_type | $attr |
unknown_type | $value |
| $nodeTypes |

[ Top ]

### method stackIsRoot [line 148]

`void stackIsRoot( )`

#### Tags:

access: | protected

[ Top ]

### method submit [line 1449]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery submit( [ $callback = null])`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $callback |

[ Top ]

### method switchWith [line 1615]

`void switchWith( $markup)`

#### Tags:

access: | public

#### Parameters:

| $markup |

[ Top ]

### method text [line 2220]

`String text( [ $text = null], [ $callback1 = null], [ $callback2 = null], [ $callback3 = null])`

Return joined text content.

#### Tags:

access: | public

#### Parameters:

| $text |
| $callback1 |
| $callback2 |
| $callback3 |

[ Top ]

### method toggleClass [line 2836]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery toggleClass( $className)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

| $className |

[ Top ]

### method toReference [line 125]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery toReference( &$var, phpQueryObject $var)`

Saves actual object to $var by reference.

Useful when need to break chain.

#### Tags:

access: | public

#### Parameters:

phpQueryObject | $var |
| &$var |

[ Top ]

### method toRoot [line 158]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery toRoot( )`

Enter description here...

NON JQUERY METHOD

TODO SUPPORT FOR end() !!! Causing problems in queryTemplates...

#### Tags:

access: | public

[ Top ]

### method trigger [line 1383]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery trigger( unknown_type $type, [unknown_type $data = array()])`

Trigger a type of event on every matched element.

#### Tags:

TODO: | support more than event in $type (space-separated)
access: | public

#### Parameters:

unknown_type | $type |
unknown_type | $data |

[ Top ]

### method triggerHandler [line 1396]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery triggerHandler( unknown_type $type, [unknown_type $data = array()])`

This particular method triggers all bound event handlers on an element (for a specific event type) WITHOUT executing the browsers default actions.

#### Tags:

TODO: |
access: | public

#### Parameters:

unknown_type | $type |
unknown_type | $data |

[ Top ]

### method unbind [line 1429]

`unknown unbind( [unknown_type $type = null], [unknown_type $callback = null])`

Enter description here...

#### Tags:

TODO: | support more than event in $type (space-separated)
TODO: | namespace events
access: | public

#### Parameters:

unknown_type | $type |
unknown_type | $callback |

[ Top ]

### method unloadDocument [line 211]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery unloadDocument( )`

Unloads whole document from memory.

CAUTION! None further operations will be possible on this document. All objects refering to it will be useless.

#### Tags:

access: | public

[ Top ]

### method val [line 2698]

`String val( [ $val = null])`

Return form element value.

#### Tags:

return: | Fields value.
access: | public

#### Parameters:

| $val |

[ Top ]

### method valid [line 2972]

`void valid( )`

#### Tags:

access: | public

Implementation of:

Iterator::valid

[ Top ]

### method whois [line 3047]

`void whois( [ $oneNode = null])`

#### Tags:

access: | public

#### Parameters:

| $oneNode |

[ Top ]

### method wrap [line 1534]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery wrap( String|phpQuery $wrapper)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

String|phpQuery | $wrapper |

[ Top ]

### method wrapAll [line 1489]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery wrapAll( String|phpQuery $wrapper)`

Enter description here...

TODO testme...

#### Tags:

access: | public

#### Parameters:

String|phpQuery | $wrapper |

[ Top ]

### method wrapAllOld [line 1470]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery wrapAllOld( String|phpQuery $wrapper)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

String|phpQuery | $wrapper |

[ Top ]

### method wrapAllPHP [line 1518]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery wrapAllPHP( String|phpQuery $codeBefore, $codeAfter)`

Enter description here...

NON JQUERY METHOD

#### Tags:

access: | public

#### Parameters:

String|phpQuery | $codeBefore |
| $codeAfter |

[ Top ]

### method wrapInner [line 1558]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery wrapInner( String|phpQuery $wrapper)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

String|phpQuery | $wrapper |

[ Top ]

### method wrapInnerPHP [line 1570]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery wrapInnerPHP( String|phpQuery $wrapper)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

String|phpQuery | $wrapper |

[ Top ]

### method wrapPHP [line 1546]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery wrapPHP( String|phpQuery $codeBefore, $codeAfter)`

Enter description here...

#### Tags:

access: | public

#### Parameters:

String|phpQuery | $codeBefore |
| $codeAfter |

[ Top ]

### method xml [line 1827]

`void xml( [ $xml = null], [ $callback1 = null], [ $callback2 = null], [ $callback3 = null])`

#### Tags:

TODO: | force xml result
access: | public

#### Parameters:

| $xml |
| $callback1 |
| $callback2 |
| $callback3 |

[ Top ]

### method xmlOuter [line 1849]

`void xmlOuter( [ $callback1 = null], [ $callback2 = null], [ $callback3 = null])`

#### Tags:

TODO: | force xml result
access: | public

#### Parameters:

| $callback1 |
| $callback2 |
| $callback3 |

[ Top ]

### method _clone [line 1684]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery _clone( )`

Enter description here...

Normal use ->clone() .

#### Tags:

access: | public

[ Top ]

### method _empty [line 2863]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery _empty( )`

Proper name without underscore (just ->empty()) also works.

Removes all child nodes from the set of matched elements.

Example: pq("p")._empty()

HTML: <p>Hello, <span>Person</span> <a href="#">and person</a></p>

Result: [ <p></p> ]

#### Tags:

access: | public

[ Top ]

### method _next [line 2292]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery _next( [ $selector = null])`

Safe rename of next().

Use it ONLY when need to call next() on an iterated object (in same time). Normaly there is no need to do such thing ;)

#### Tags:

access: | public

#### Parameters:

| $selector |

[ Top ]

### method _prev [line 2304]

`phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery _prev( [ $selector = null])`

Use prev() and next().

#### Tags:

deprecated: |
access: | public

#### Parameters:

| $selector |

[ Top ]

### method __call [line 2264]

`unknown_type __call( $method $method, $args $args)`

#### Tags:

access: | public

#### Parameters:

$method | $method |
$args | $args |

[ Top ]

### method __get [line 109]

`unknown_type __get( $attr $attr)`

#### Tags:

access: | public

#### Parameters:

$attr | $attr |

[ Top ]

### method __loadSuccess [line 1339]

`unknown_type __loadSuccess( $html $html)`

#### Tags:

access: | public

#### Parameters:

$html | $html |

[ Top ]

### method __pseudoClassParam [line 1109]

`void __pseudoClassParam( $paramsString)`

#### Tags:

access: | protected

#### Parameters:

| $paramsString |

[ Top ]

### method __toString [line 1853]

`void __toString( )`

#### Tags:

access: | public

[ Top ]

### method ___wrapAllCallback [line 1504]

`unknown_type ___wrapAllCallback( $node $node)`

#### Tags:

access: | public

#### Parameters:

$node | $node |

[ Top ]

Documentation generated on Tue, 18 Nov 2008 19:39:26 +0100 by phpDocumentor 1.4.2