\phpQueryObject
Class representing phpQuery objects.
- Author: Tobiasz Cudnik <tobiasz.cudnik/gmail.com>
Synopsis
class phpQueryObject
implements
Iterator,Countable,ArrayAccess
{
- // members
- public $documentID = NULL;
- public DOMDocument $document = NULL;
- public $charset = NULL;
- public DOMDocumentWrapper $documentWrapper = NULL;
- public DOMXPath $xpath = NULL;
- public array $elements = ;
- protected array $elementsBackup = ;
- protected $previous = NULL;
- protected array $root = ;
- public bool $documentFragment = true;
- protected array $elementsInterator = ;
- protected boolean $valid = false;
- protected $current = NULL;
- // methods
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery __construct()
- public unknown_type __get()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery toReference()
- public void documentFragment()
- protected void isRoot()
- protected void stackIsRoot()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery toRoot()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery getDocumentIDRef()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery getDocument()
- public DOMDocument getDOMDocument()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery getDocumentID()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery unloadDocument()
- public void isHTML()
- public void isXHTML()
- public void isXML()
- public string serialize()
- public array serializeArray()
- protected void debug()
- protected void isRegexp()
- protected bool isChar()
- protected void parseSelector()
- public array|DOMElement get()
- public array|string getString()
- public array|string getStrings()
- public void newInstance()
- protected boolean matchClasses()
- protected void runQuery()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery find()
- protected void pseudoClasses()
- protected void __pseudoClassParam()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery is()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery filterCallback()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery filter()
- protected static unknown_type unQuote()
- public phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery load()
- public unknown_type __loadSuccess()
- public phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery css()
- public void show()
- public void hide()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery trigger()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery triggerHandler()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery bind()
- public unknown unbind()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery change()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery submit()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery click()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery wrapAllOld()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery wrapAll()
- public unknown_type ___wrapAllCallback()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery wrapAllPHP()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery wrap()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery wrapPHP()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery wrapInner()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery wrapInnerPHP()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery contents()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery contentsUnwrap()
- public void switchWith()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery eq()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery size()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery length()
- public void count()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery end()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery _clone()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery replaceWithPHP()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery replaceWith()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery replaceAll()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery remove()
- protected void markupEvents()
- public unknown_type markup()
- public unknown_type markupOuter()
- public string|phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery html()
- public void xml()
- public String htmlOuter()
- public void xmlOuter()
- public void __toString()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery php()
- public unknown_type markupPHP()
- public unknown_type markupOuterPHP()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery children()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery ancestors()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery append()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery appendPHP()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery appendTo()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery prepend()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery prependPHP()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery prependTo()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery before()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery beforePHP()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery insertBefore()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery after()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery afterPHP()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery insertAfter()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery insert()
- public Int index()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery slice()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery reverse()
- public String text()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery plugin()
- public static unknown_type extend()
- public unknown_type __call()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery _next()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery _prev()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery prev()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery prevAll()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery nextAll()
- protected void getElementSiblings()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery siblings()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery not()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery add()
- protected void merge()
- protected void elementsContainsNode()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery parent()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery parents()
- public void stack()
- protected void attrEvents()
- public void attr()
- protected void getNodeAttrs()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery attrPHP()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery removeAttr()
- public String val()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery andSelf()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery addClass()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery addClassPHP()
- public bool hasClass()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery removeClass()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery toggleClass()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery _empty()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery each()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery callback()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery map()
- public void data()
- public void removeData()
- public void rewind()
- public void current()
- public void key()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery next()
- public void valid()
- public void offsetExists()
- public void offsetGet()
- public void offsetSet()
- public void offsetUnset()
- protected string getNodeXpath()
- public void whois()
- public phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery dump()
- public void dumpWhois()
- public void dumpLength()
- public void dumpTree()
- private void __dumpTree()
- public void dumpDie()
Hierarchy
Implements
Tasks
Line | Task |
---|---|
+ | refactor to ->nodes |
+ | deprecate |
100 | check $this->DOM->documentElement; |
142+ | documentWrapper |
303+ | rewrite me to charcode range ! ;) |
313 | include this inside parsing ? |
504+ | implement callbacks |
504+ | return only arrays ? |
504+ | maybe other name... |
531+ | implement callbacks |
531+ | return only arrays ? |
531+ | maybe other name... |
692 | combine code below with phpQuery::pq() context guessing code |
851+ | create API for classes with pseudoselectors |
852 | clean args parsing ? |
1118 | ; |
1310+ | implement in all methods using passed parameters |
1322+ | Support $selector |
1369+ | |
1370 | |
1377+ | |
1378 | |
1385+ | |
1386 | |
1397+ | support more than event in $type (space-separated) |
1410+ | |
1411 | ; |
1424+ | support '!' (exclusive) events |
1424+ | support more than event in $type (space-separated) |
1425 | check if $data is callable, not using is_callable |
1443+ | namespace events |
1443+ | support more than event in $type (space-separated) |
1678+ | $level |
1730+ | this works ? |
1781+ | trigger change event for textarea |
1808+ | force html result |
1841+ | force xml result |
1851+ | force html result |
1863+ | force xml result |
1876+ | support returning markup with PHP tags when called without param |
1968+ | accept many arguments, which are joined, arrays maybe also |
2356+ | |
2365+ | FIXME: returns source elements insted of next siblings |
2648+ | check CDATA ??? |
2904+ | add $scope and $args as in each() ??? |
3044+ | use native getNodePath is avaible |
Members
protected
-
$current
Iterator interface helper - $elementsBackup
-
$elementsInterator
Iterator interface helper - $previous
- $root
-
$valid
Iterator interface helper
public
- $charset
- $document
—
DOMDocument
DOMDocument class. - $documentFragment
—
bool
Indicated if doument is just a fragment (no <html> tag). - $documentID
- $documentWrapper — DOMDocumentWrapper
- $elements
—
array
Stack of selected elements. - $xpath
—
DOMXPath
XPath interface.
Methods
private
protected
- __pseudoClassParam()
- attrEvents()
- debug()
- elementsContainsNode()
- getElementSiblings()
- getNodeAttrs()
- getNodeXpath() — Returns node's XPath.
- isChar() — Determines if $char is really a char.
- isRegexp()
- isRoot()
- markupEvents()
- matchClasses() — Enter description here...
- merge()
- parseSelector()
- pseudoClasses()
- runQuery()
- stackIsRoot()
- unQuote()
public
- __construct() — Enter description here...
- ___wrapAllCallback()
- __call()
- __get()
- __loadSuccess()
- __toString()
- _clone() — Enter description here...
- _empty() — Proper name without underscore (just ->empty()) also works.
- _next() — Safe rename of next().
- _prev() — Use prev() and next().
- add() — Enter description here...
- addClass() — Enter description here...
- addClassPHP() — Enter description here...
- after() — Enter description here...
- afterPHP() — Enter description here...
- ancestors() — Enter description here...
- andSelf() — Enter description here...
- append() — Enter description here...
- appendPHP() — Enter description here...
- appendTo() — Enter description here...
- attr()
- attrPHP() — Enter description here...
- before() — Enter description here...
- beforePHP() — Enter description here...
- bind() — Binds a handler to one or more events (like click) for each matched element.
- callback() — Run callback on actual object.
- change() — Enter description here...
- children() — Enter description here...
- click() — Enter description here...
- contents() — Enter description here...
- contentsUnwrap() — Enter description here...
- count()
- css() — Enter description here...
- current()
- data() — Enter description here...
- documentFragment()
- dump() — Dump htmlOuter and preserve chain. Usefull for debugging.
- dumpDie() — Dump htmlOuter and stop script execution. Usefull for debugging.
- dumpLength()
- dumpTree()
- dumpWhois()
- each() — Enter description here...
- end() — Enter description here...
- eq() — Enter description here...
- extend() — Deprecated, use $pq->plugin() instead.
- filter() — Enter description here...
- filterCallback() — Enter description here...
- find() — Enter description here...
- get() — Return matched DOM nodes.
- getDOMDocument()
- getDocument() — Returns object with stack set to document root.
- getDocumentID() — Get object's Document ID.
- getDocumentIDRef() — Saves object's DocumentID to $var by reference.
- getString() — Return matched DOM nodes.
- getStrings() — Return matched DOM nodes.
- hasClass() — Enter description here...
- hide()
- html() — Enter description here...
- htmlOuter() — Enter description here...
- index() — Enter description here...
- insert() — Internal insert method. Don't use it.
- insertAfter() — Enter description here...
- insertBefore() — Enter description here...
- is() — Enter description here...
- isHTML()
- isXHTML()
- isXML()
- key()
- length() — Enter description here...
- load() — Enter description here...
- map() — Enter description here...
- markup() — jQuey difference
- markupOuter() — jQuey difference
- markupOuterPHP() — Enter description here...
- markupPHP() — Enter description here...
- newInstance() — Returns new instance of actual class.
- next() — Double-function method.
- nextAll()
- not() — Enter description here...
- offsetExists()
- offsetGet()
- offsetSet()
- offsetUnset()
- parent() — Enter description here...
- parents() — Enter description here...
- php() — Just like html(), but returns markup with VALID (dangerous) PHP tags.
- plugin() — Enter description here...
- prepend() — Enter description here...
- prependPHP() — Enter description here...
- prependTo() — Enter description here...
- prev() — Enter description here...
- prevAll()
- remove() — Enter description here...
- removeAttr() — Enter description here...
- removeClass() — Enter description here...
- removeData() — Enter description here...
- replaceAll() — Enter description here...
- replaceWith() — Enter description here...
- replaceWithPHP() — Enter description here...
- reverse() — Enter description here...
- rewind()
- serialize() — Enter description here...
- serializeArray() — Enter description here...
- show()
- siblings() — Enter description here...
- size() — Enter description here...
- slice() — Enter description here...
- stack() — Internal stack iterator.
- submit() — Enter description here...
- switchWith() — Enter description here...
- text() — Return joined text content.
- toReference() — Saves actual object to $var by reference.
- toRoot() — Enter description here...
- toggleClass() — Enter description here...
- trigger() — Trigger a type of event on every matched element.
- triggerHandler() — This particular method triggers all bound event handlers on an element (for a specific event type) WITHOUT executing the browsers default actions.
- unbind() — Enter description here...
- unloadDocument() — Unloads whole document from memory.
- val() — Return form element value.
- valid()
- whois()
- wrap() — Enter description here...
- wrapAll() — Enter description here...
- wrapAllOld() — Enter description here...
- wrapAllPHP() — Enter description here...
- wrapInner() — Enter description here...
- wrapInnerPHP() — Enter description here...
- wrapPHP() — Enter description here...
- xml()
- xmlOuter()