[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/_test/core/ -> phpQuery-onefile.php (summary)

phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library.

Author: Tobiasz Cudnik
License: http://www.opensource.org/licenses/mit-license.php MIT License
Link: http://code.google.com/p/phpquery/
Link: http://phpquery-library.blogspot.com/
Link: http://jquery.com/
Version: 0.9.5
File Size: 5702 lines (209 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 13 classes

DOMEvent:: (3 methods):
  __construct()
  preventDefault()
  stopPropagation()

DOMDocumentWrapper:: (29 methods):
  __construct()
  load()
  afterMarkupLoad()
  loadMarkup()
  loadMarkupReset()
  documentCreate()
  loadMarkupHTML()
  loadMarkupXML()
  isXHTML()
  isXML()
  contentTypeToArray()
  contentTypeFromHTML()
  charsetFromHTML()
  charsetFromXML()
  charsetFixHTML()
  charsetAppendToHTML()
  charsetAppendToXML()
  isDocumentFragmentHTML()
  isDocumentFragmentXML()
  isDocumentFragmentXHTML()
  importAttr()
  import()
  documentFragmentCreate()
  documentFragmentLoadMarkup()
  documentFragmentToMarkup()
  markup()
  markupFixXHTML()
  debug()
  expandEmptyTag()

phpQueryEvents:: (6 methods):
  trigger()
  add()
  remove()
  getNode()
  setNode()
  issetGlobal()

ICallbackNamed:: (2 methods):
  hasName()
  getName()

Callback:: (4 methods):
  __construct()
  getName()
  hasName()
  setName()

CallbackBody:: (1 method):
  __construct()

CallbackReturnReference:: (4 methods):
  __construct()
  callback()
  getName()
  hasName()

CallbackReturnValue:: (5 methods):
  __construct()
  callback()
  __toString()
  getName()
  hasName()

CallbackParameterToReference:: (1 method):
  __construct()

CallbackParam:: (0 methods):

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

phpQuery:: (59 methods):
  pq()
  selectDocument()
  getDocument()
  newDocument()
  newDocumentHTML()
  newDocumentXML()
  newDocumentXHTML()
  newDocumentPHP()
  phpToMarkup()
  _phpToMarkupCallback()
  _markupToPHPCallback()
  markupToPHP()
  newDocumentFile()
  newDocumentFileHTML()
  newDocumentFileXML()
  newDocumentFileXHTML()
  newDocumentFilePHP()
  loadDocument()
  createDocumentWrapper()
  extend()
  plugin()
  unloadDocuments()
  unsafePHPTags()
  DOMNodeListToArray()
  isMarkup()
  debug()
  ajax()
  httpData()
  param()
  get()
  post()
  getJSON()
  ajaxSetup()
  ajaxAllowHost()
  ajaxAllowURL()
  toJSON()
  parseJSON()
  getDocumentID()
  getDOMDocument()
  makeArray()
  inArray()
  each()
  map()
  callbackRun()
  merge()
  grep()
  unique()
  isFunction()
  trim()
  browserGet()
  browserPost()
  browser()
  php()
  code()
  __callStatic()
  dataSetupNode()
  dataRemoveNode()
  data()
  removeData()

phpQueryPlugins:: (2 methods):
  __call()
  pq()


Class: DOMEvent  - X-Ref

DOMEvent class.

Based on
__construct($data)   X-Ref
No description

preventDefault()   X-Ref
Cancels the event (if it is cancelable).


stopPropagation()   X-Ref
Stops the propagation of events further along in the DOM.


Class: DOMDocumentWrapper  - X-Ref

DOMDocumentWrapper class simplifies work with DOMDocument.

Know bug:
- in XHTML fragments, <br /> changes to <br clear="none" />

__construct($markup = null, $contentType = null, $newDocumentID = null)   X-Ref
No description

load($markup, $contentType = null, $newDocumentID = null)   X-Ref
No description

afterMarkupLoad()   X-Ref
No description

loadMarkup($markup)   X-Ref
No description

loadMarkupReset()   X-Ref
No description

documentCreate($charset, $version = '1.0')   X-Ref
No description

loadMarkupHTML($markup, $requestedCharset = null)   X-Ref
No description

loadMarkupXML($markup, $requestedCharset = null)   X-Ref
No description

isXHTML($markup = null)   X-Ref
No description

isXML($markup)   X-Ref
No description

contentTypeToArray($contentType)   X-Ref
No description

contentTypeFromHTML($markup)   X-Ref

param: $markup
return: array contentType, charset

charsetFromHTML($markup)   X-Ref
No description

charsetFromXML($markup)   X-Ref
No description

charsetFixHTML($markup)   X-Ref
Repositions meta[type=charset] at the start of head. Bypasses DOMDocument bug.

param: $html
link: http://code.google.com/p/phpquery/issues/detail?id=80

charsetAppendToHTML($html, $charset, $xhtml = false)   X-Ref
No description

charsetAppendToXML($markup, $charset)   X-Ref
No description

isDocumentFragmentHTML($markup)   X-Ref
No description

isDocumentFragmentXML($markup)   X-Ref
No description

isDocumentFragmentXHTML($markup)   X-Ref
No description

importAttr($value)   X-Ref
No description

import($source, $sourceCharset = null)   X-Ref

param: $source
param: $target
param: $sourceCharset
return: array Array of imported nodes.

documentFragmentCreate($source, $charset = null)   X-Ref
Creates new document fragment.

param: $source
return: DOMDocumentWrapper

documentFragmentLoadMarkup($fragment, $charset, $markup = null)   X-Ref

param: $document DOMDocumentWrapper
param: $markup
return: $document

documentFragmentToMarkup($fragment)   X-Ref
No description

markup($nodes = null, $innerMarkup = false)   X-Ref
Return document markup, starting with optional $nodes as root.

param: $nodes    DOMNode|DOMNodeList
return: string

markupFixXHTML($markup)   X-Ref
No description

debug($text)   X-Ref
No description

expandEmptyTag($tag, $xml)   X-Ref
expandEmptyTag

param: $tag
param: $xml
link: http://php.net/manual/en/domdocument.savehtml.php#81256
return: unknown_type
author: mjaque at ilkebenson dot com

Class: phpQueryEvents  - X-Ref

Event handling class.

trigger($document, $type, $data = array()   X-Ref
Trigger a type of event on every matched element.

param: DOMNode|phpQueryObject|string $document
param: unknown_type $type
param: unknown_type $data

add($document, $node, $type, $data, $callback = null)   X-Ref
Binds a handler to one or more events (like click) for each matched element.
Can also bind custom events.

param: DOMNode|phpQueryObject|string $document
param: unknown_type $type
param: unknown_type $data Optional
param: unknown_type $callback

remove($document, $node, $type = null, $callback = null)   X-Ref
Enter description here...

param: DOMNode|phpQueryObject|string $document
param: unknown_type $type
param: unknown_type $callback

getNode($documentID, $node)   X-Ref
No description

setNode($documentID, $node)   X-Ref
No description

issetGlobal($documentID, $type)   X-Ref
No description

Interface: ICallbackNamed  - X-Ref

hasName()   X-Ref
No description

getName()   X-Ref
No description

Class: Callback  - X-Ref

Callback class introduces currying-like pattern.

Example:
function foo($param1, $param2, $param3) {
var_dump($param1, $param2, $param3);
}
$fooCurried = new Callback('foo',
'param1 is now statically set',
new CallbackParam, new CallbackParam
);
phpQuery::callbackRun($fooCurried,
array('param2 value', 'param3 value'
);

Callback class is supported in all phpQuery methods which accepts callbacks.

__construct($callback, $param1 = null, $param2 = null,$param3 = null)   X-Ref
No description

getName()   X-Ref
No description

hasName()   X-Ref
No description

setName($name)   X-Ref
No description

Class: CallbackBody  - X-Ref

Shorthand for new Callback(create_function(...), ...);

__construct($paramList, $code, $param1 = null, $param2 = null,$param3 = null)   X-Ref
No description

Class: CallbackReturnReference  - X-Ref

Callback type which on execution returns reference passed during creation.

__construct(&$reference, $name = null)   X-Ref
No description

callback()   X-Ref
No description

getName()   X-Ref
No description

hasName()   X-Ref
No description

Class: CallbackReturnValue  - X-Ref

Callback type which on execution returns value passed during creation.

__construct($value, $name = null)   X-Ref
No description

callback()   X-Ref
No description

__toString()   X-Ref
No description

getName()   X-Ref
No description

hasName()   X-Ref
No description

Class: CallbackParameterToReference  - X-Ref

CallbackParameterToReference can be used when we don't really want a callback,
only parameter passed to it. CallbackParameterToReference takes first
parameter's value and passes it to reference.

__construct(&$reference)   X-Ref

param: $reference

Class: CallbackParam  - X-Ref

Class: phpQueryObject  - X-Ref

Class representing phpQuery objects.

__construct($documentID)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

__get($attr)   X-Ref

param: $attr
return: unknown_type

toReference(&$var)   X-Ref
Saves actual object to $var by reference.
Useful when need to break chain.

param: phpQueryObject $var
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

documentFragment($state = null)   X-Ref
No description

isRoot( $node)   X-Ref


stackIsRoot()   X-Ref


toRoot()   X-Ref
Enter description here...
NON JQUERY METHOD

Watch out, it doesn't creates new instance, can be reverted with end().

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

getDocumentIDRef(&$documentID)   X-Ref
Saves object's DocumentID to $var by reference.
<code>
$myDocumentId;
phpQuery::newDocument('<div/>')
->getDocumentIDRef($myDocumentId)
->find('div')->...
</code>

param: unknown_type $domId
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
see: phpQuery::newDocument
see: phpQuery::newDocumentFile

getDocument()   X-Ref
Returns object with stack set to document root.

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

getDOMDocument()   X-Ref

return: DOMDocument

getDocumentID()   X-Ref
Get object's Document ID.

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

unloadDocument()   X-Ref
Unloads whole document from memory.
CAUTION! None further operations will be possible on this document.
All objects refering to it will be useless.

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

isHTML()   X-Ref
No description

isXHTML()   X-Ref
No description

isXML()   X-Ref
No description

serialize()   X-Ref
Enter description here...

link: http://docs.jquery.com/Ajax/serialize
return: string

serializeArray($submit = null)   X-Ref
Enter description here...

link: http://docs.jquery.com/Ajax/serializeArray
return: array

debug($in)   X-Ref


isRegexp($pattern)   X-Ref


isChar($char)   X-Ref
Determines if $char is really a char.

param: string $char
return: bool

parseSelector($query)   X-Ref


get($index = null, $callback1 = null, $callback2 = null, $callback3 = null)   X-Ref
Return matched DOM nodes.

param: int $index
return: array|DOMElement Single DOMElement or array of DOMElement.

getString($index = null, $callback1 = null, $callback2 = null, $callback3 = null)   X-Ref
Return matched DOM nodes.
jQuery difference.

param: int $index
return: array|string Returns string if $index != null

getStrings($index = null, $callback1 = null, $callback2 = null, $callback3 = null)   X-Ref
Return matched DOM nodes.
jQuery difference.

param: int $index
return: array|string Returns string if $index != null

newInstance($newStack = null)   X-Ref
Returns new instance of actual class.

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

matchClasses($class, $node)   X-Ref
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")
param: unknown_type $class
param: unknown_type $node
return: boolean

runQuery($XQuery, $selector = null, $compare = null)   X-Ref


find($selectors, $context = null, $noHistory = false)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

pseudoClasses($class)   X-Ref


__pseudoClassParam($paramsString)   X-Ref


is($selector, $nodes = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

filterCallback($callback, $_skipHistory = false)   X-Ref
Enter description here...
jQuery difference.

Callback:
- $index int
- $node DOMNode

link: http://docs.jquery.com/Traversing/filter
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

filter($selectors, $_skipHistory = false)   X-Ref
Enter description here...

link: http://docs.jquery.com/Traversing/filter
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

unQuote($value)   X-Ref

param: $value
return: unknown_type

load($url, $data = null, $callback = null)   X-Ref
Enter description here...

link: http://docs.jquery.com/Ajax/load
return: phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

__loadSuccess($html)   X-Ref

param: $html
return: unknown_type

css()   X-Ref
Enter description here...

return: phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

show()   X-Ref


hide()   X-Ref


trigger($type, $data = array()   X-Ref
Trigger a type of event on every matched element.

param: unknown_type $type
param: unknown_type $data
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

triggerHandler($type, $data = array()   X-Ref
This particular method triggers all bound event handlers on an element (for a specific event type) WITHOUT executing the browsers default actions.

param: unknown_type $type
param: unknown_type $data
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

bind($type, $data, $callback = null)   X-Ref
Binds a handler to one or more events (like click) for each matched element.
Can also bind custom events.

param: unknown_type $type
param: unknown_type $data Optional
param: unknown_type $callback
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

unbind($type = null, $callback = null)   X-Ref
Enter description here...

param: unknown_type $type
param: unknown_type $callback
return: unknown

change($callback = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

submit($callback = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

click($callback = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

wrapAllOld($wrapper)   X-Ref
Enter description here...

param: String|phpQuery
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

wrapAll($wrapper)   X-Ref
Enter description here...

TODO testme...
param: String|phpQuery
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

___wrapAllCallback($node)   X-Ref

param: $node
return: unknown_type

wrapAllPHP($codeBefore, $codeAfter)   X-Ref
Enter description here...
NON JQUERY METHOD

param: String|phpQuery
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

wrap($wrapper)   X-Ref
Enter description here...

param: String|phpQuery
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

wrapPHP($codeBefore, $codeAfter)   X-Ref
Enter description here...

param: String|phpQuery
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

wrapInner($wrapper)   X-Ref
Enter description here...

param: String|phpQuery
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

wrapInnerPHP($codeBefore, $codeAfter)   X-Ref
Enter description here...

param: String|phpQuery
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

contents()   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

contentsUnwrap()   X-Ref
Enter description here...

jQuery difference.

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

switchWith($markup)   X-Ref
Enter description here...

jQuery difference.

eq($num)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

size()   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

length()   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

count()   X-Ref
No description

end($level = 1)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

_clone()   X-Ref
Enter description here...
Normal use ->clone() .

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

replaceWithPHP($code)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

replaceWith($content)   X-Ref
Enter description here...

param: String|phpQuery $content
link: http://docs.jquery.com/Manipulation/replaceWith#content
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

replaceAll($selector)   X-Ref
Enter description here...

param: String $selector
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

remove($selector = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

markupEvents($newMarkup, $oldMarkup, $node)   X-Ref
No description

markup($markup = null, $callback1 = null, $callback2 = null, $callback3 = null)   X-Ref
jQuey difference

param: $markup
return: unknown_type

markupOuter($callback1 = null, $callback2 = null, $callback3 = null)   X-Ref
jQuey difference

param: $markup
return: unknown_type

html($html = null, $callback1 = null, $callback2 = null, $callback3 = null)   X-Ref
Enter description here...

param: unknown_type $html
return: string|phpQuery|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

xml($xml = null, $callback1 = null, $callback2 = null, $callback3 = null)   X-Ref


htmlOuter($callback1 = null, $callback2 = null, $callback3 = null)   X-Ref
Enter description here...

return: String

xmlOuter($callback1 = null, $callback2 = null, $callback3 = null)   X-Ref


__toString()   X-Ref
No description

php($code = null)   X-Ref
Just like html(), but returns markup with VALID (dangerous) PHP tags.

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

markupPHP($code = null)   X-Ref
Enter description here...

param: $code
return: unknown_type

markupOuterPHP()   X-Ref
Enter description here...

param: $code
return: unknown_type

children($selector = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

ancestors($selector = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

append( $content)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

appendPHP( $content)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

appendTo( $seletor)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

prepend( $content)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

prependPHP( $content)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

prependTo( $seletor)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

before($content)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

beforePHP( $content)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

insertBefore( $seletor)   X-Ref
Enter description here...

param: String|phpQuery
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

after( $content)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

afterPHP( $content)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

insertAfter( $seletor)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

insert($target, $type)   X-Ref
Internal insert method. Don't use it.

param: unknown_type $target
param: unknown_type $type
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

index($subject)   X-Ref
Enter description here...

return: Int

slice($start, $end = null)   X-Ref
Enter description here...

param: unknown_type $start
param: unknown_type $end
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

reverse()   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

text($text = null, $callback1 = null, $callback2 = null, $callback3 = null)   X-Ref
Return joined text content.

return: String

plugin($class, $file = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

extend($class, $file = null)   X-Ref
Deprecated, use $pq->plugin() instead.

param: $class
param: $file
return: unknown_type

__call($method, $args)   X-Ref

param: $method
param: $args
return: unknown_type

_next($selector = null)   X-Ref
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 ;)

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

_prev($selector = null)   X-Ref
Use prev() and next().

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

prev($selector = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

prevAll($selector = null)   X-Ref

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

nextAll($selector = null)   X-Ref

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

getElementSiblings($direction, $selector = null, $limitToOne = false)   X-Ref


siblings($selector = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

not($selector = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

add($selector = null)   X-Ref
Enter description here...

param: string|phpQueryObject
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

merge()   X-Ref


elementsContainsNode($nodeToCheck, $elementsStack = null)   X-Ref


parent($selector = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

parents($selector = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

stack($nodeTypes = null)   X-Ref
Internal stack iterator.


attrEvents($attr, $oldAttr, $oldValue, $node)   X-Ref
No description

attr($attr = null, $value = null)   X-Ref
No description

getNodeAttrs($node)   X-Ref


attrPHP($attr, $code)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

removeAttr($attr)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

val($val = null)   X-Ref
Return form element value.

return: String Fields value.

andSelf()   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

addClass( $className)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

addClassPHP( $className)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

hasClass($className)   X-Ref
Enter description here...

param: string  $className
return: bool

removeClass($className)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

toggleClass($className)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

_empty()   X-Ref
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> ]

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

each($callback, $param1 = null, $param2 = null, $param3 = null)   X-Ref
Enter description here...

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

callback($callback, $param1 = null, $param2 = null, $param3 = null)   X-Ref
Run callback on actual object.

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

map($callback, $param1 = null, $param2 = null, $param3 = null)   X-Ref
Enter description here...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

data($key, $value = null)   X-Ref
Enter description here...

param: <type> $key
param: <type> $value

removeData($key)   X-Ref
Enter description here...

param: <type> $key

rewind()   X-Ref


current()   X-Ref


key()   X-Ref


next($cssSelector = null)   X-Ref
Double-function method.

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

Proper functionality is choosed automagicaly.

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
see: phpQueryObject::_next()

valid()   X-Ref


offsetExists($offset)   X-Ref


offsetGet($offset)   X-Ref


offsetSet($offset, $value)   X-Ref


offsetUnset($offset)   X-Ref


getNodeXpath($oneNode = null, $namespace = null)   X-Ref
Returns node's XPath.

param: unknown_type $oneNode
return: string

whois($oneNode = null)   X-Ref
No description

dump()   X-Ref
Dump htmlOuter and preserve chain. Usefull for debugging.

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

dumpWhois()   X-Ref
No description

dumpLength()   X-Ref
No description

dumpTree($html = true, $title = true)   X-Ref
No description

__dumpTree($node, $intend = 0)   X-Ref
No description

dumpDie()   X-Ref
Dump htmlOuter and stop script execution. Usefull for debugging.


mb_internal_encoding($enc)   X-Ref
mb_internal_encoding()

Included for mbstring pseudo-compatability.

mb_regex_encoding($enc)   X-Ref
mb_regex_encoding()

Included for mbstring pseudo-compatability.

mb_strlen($str)   X-Ref
mb_strlen()

Included for mbstring pseudo-compatability.

mb_strpos($haystack, $needle, $offset=0)   X-Ref
mb_strpos()

Included for mbstring pseudo-compatability.

mb_stripos($haystack, $needle, $offset=0)   X-Ref
mb_stripos()

Included for mbstring pseudo-compatability.

mb_substr($str, $start, $length=0)   X-Ref
mb_substr()

Included for mbstring pseudo-compatability.

mb_substr_count($haystack, $needle)   X-Ref
mb_substr_count()

Included for mbstring pseudo-compatability.

Class: phpQuery  - X-Ref

Static namespace for phpQuery functions.

pq($arg1, $context = null)   X-Ref
Multi-purpose function.
Use pq() as shortcut.

In below examples, $pq is any result of pq(); function.

1. Import markup into existing document (without any attaching):
- Import into selected document:
pq('<div/>')               // DOESNT accept text nodes at beginning of input string !
- Import into document with ID from $pq->getDocumentID():
pq('<div/>', $pq->getDocumentID())
- Import into same document as DOMNode belongs to:
pq('<div/>', DOMNode)
- Import into document from phpQuery object:
pq('<div/>', $pq)

2. Run query:
- Run query on last selected document:
pq('div.myClass')
- Run query on document with ID from $pq->getDocumentID():
pq('div.myClass', $pq->getDocumentID())
- Run query on same document as DOMNode belongs to and use node(s)as root for query:
pq('div.myClass', DOMNode)
- Run query on document from phpQuery object
and use object's stack as root node(s) for query:
pq('div.myClass', $pq)

param: string|DOMNode|DOMNodeList|array  $arg1   HTML markup, CSS Selector, DOMNode or array of DOMNodes
param: string|phpQueryObject|DOMNode $context    DOM ID from $pq->getDocumentID(), phpQuery object (determines also query root) or DOMNode (determines also query root)
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery|false

selectDocument($id)   X-Ref
Sets default document to $id. Document has to be loaded prior
to using this method.
$id can be retrived via getDocumentID() or getDocumentIDRef().

param: unknown_type $id

getDocument($id = null)   X-Ref
Returns document with id $id or last used as phpQueryObject.
$id can be retrived via getDocumentID() or getDocumentIDRef().
Chainable.

param: unknown_type $id
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
see: phpQuery::selectDocument()

newDocument($markup = null, $contentType = null)   X-Ref
Creates new document from markup.
Chainable.

param: unknown_type $markup
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

newDocumentHTML($markup = null, $charset = null)   X-Ref
Creates new document from markup.
Chainable.

param: unknown_type $markup
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

newDocumentXML($markup = null, $charset = null)   X-Ref
Creates new document from markup.
Chainable.

param: unknown_type $markup
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

newDocumentXHTML($markup = null, $charset = null)   X-Ref
Creates new document from markup.
Chainable.

param: unknown_type $markup
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

newDocumentPHP($markup = null, $contentType = "text/html")   X-Ref
Creates new document from markup.
Chainable.

param: unknown_type $markup
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

phpToMarkup($php, $charset = 'utf-8')   X-Ref
No description

_phpToMarkupCallback($php, $charset = 'utf-8')   X-Ref
No description

_markupToPHPCallback($m)   X-Ref
No description

markupToPHP($content)   X-Ref
Converts document markup containing PHP code generated by phpQuery::php()
into valid (executable) PHP code syntax.

param: string|phpQueryObject $content
return: string PHP code.

newDocumentFile($file, $contentType = null)   X-Ref
Creates new document from file $file.
Chainable.

param: string $file URLs allowed. See File wrapper page at php.net for more supported sources.
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

newDocumentFileHTML($file, $charset = null)   X-Ref
Creates new document from markup.
Chainable.

param: unknown_type $markup
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

newDocumentFileXML($file, $charset = null)   X-Ref
Creates new document from markup.
Chainable.

param: unknown_type $markup
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

newDocumentFileXHTML($file, $charset = null)   X-Ref
Creates new document from markup.
Chainable.

param: unknown_type $markup
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

newDocumentFilePHP($file, $contentType = null)   X-Ref
Creates new document from markup.
Chainable.

param: unknown_type $markup
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

loadDocument($document)   X-Ref
Reuses existing DOMDocument object.
Chainable.

param: $document DOMDocument
return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery

createDocumentWrapper($html, $contentType = null, $documentID = null)   X-Ref
Enter description here...

param: unknown_type $html
param: unknown_type $domId
return: unknown New DOM ID

extend($target, $source)   X-Ref
Extend class namespace.

param: string|array $target
param: array $source
return: unknown_type

plugin($class, $file = null)   X-Ref
Extend phpQuery with $class from $file.

param: string $class Extending class name. Real class name can be prepended phpQuery_.
param: string $file Filename to include. Defaults to "{$class}.php".

unloadDocuments($id = null)   X-Ref
Unloades all or specified document from memory.

param: mixed $documentID @see phpQuery::getDocumentID() for supported types.

unsafePHPTags($content)   X-Ref
Parses phpQuery object or HTML result against PHP tags and makes them active.

param: phpQuery|string $content
return: string

DOMNodeListToArray($DOMNodeList)   X-Ref
No description

isMarkup($input)   X-Ref
Checks if $input is HTML string, which has to start with '<'.

param: String $input
return: Bool

debug($text)   X-Ref
No description

ajax($options = array()   X-Ref
Make an AJAX request.

param: array See $options http://docs.jquery.com/Ajax/jQuery.ajax#toptions
link: http://docs.jquery.com/Ajax/jQuery.ajax
return: Zend_Http_Client

httpData($data, $type, $options)   X-Ref
No description

param($data)   X-Ref
Enter description here...

param: array|phpQuery $data

get($url, $data = null, $callback = null, $type = null)   X-Ref
No description

post($url, $data = null, $callback = null, $type = null)   X-Ref
No description

getJSON($url, $data = null, $callback = null)   X-Ref
No description

ajaxSetup($options)   X-Ref
No description

ajaxAllowHost($host1, $host2 = null, $host3 = null)   X-Ref
No description

ajaxAllowURL($url1, $url2 = null, $url3 = null)   X-Ref
No description

toJSON($data)   X-Ref
Returns JSON representation of $data.

param: mixed $data
return: string

parseJSON($json)   X-Ref
Parses JSON into proper PHP type.

param: string $json
return: mixed

getDocumentID($source)   X-Ref
Returns source's document ID.

param: $source DOMNode|phpQueryObject
return: string

getDOMDocument($source)   X-Ref
Get DOMDocument object related to $source.
Returns null if such document doesn't exist.

param: $source DOMNode|phpQueryObject|string
return: string

makeArray($obj)   X-Ref

link: http://docs.jquery.com/Utilities/jQuery.makeArray
return: unknown_type

inArray($value, $array)   X-Ref
No description

each($object, $callback, $param1 = null, $param2 = null, $param3 = null)   X-Ref

param: $object
param: $callback
link: http://docs.jquery.com/Utilities/jQuery.each
return: unknown_type

map($array, $callback, $param1 = null, $param2 = null, $param3 = null)   X-Ref

link: http://docs.jquery.com/Utilities/jQuery.map

callbackRun($callback, $params = array()   X-Ref

param: $callback Callback
param: $params
param: $paramStructure
return: unknown_type

merge($one, $two)   X-Ref
Merge 2 phpQuery objects.

param: array $one
param: array $two

grep($array, $callback, $invert = false)   X-Ref

param: $array
param: $callback
param: $invert
link: http://docs.jquery.com/Utilities/jQuery.grep
return: unknown_type

unique($array)   X-Ref
No description

isFunction($function)   X-Ref

param: $function
return: unknown_type

trim($str)   X-Ref
No description

browserGet($url, $callback, $param1 = null, $param2 = null, $param3 = null)   X-Ref

param: $url
param: $callback
param: $param1
param: $param2
param: $param3
return: phpQueryObject

browserPost($url, $data, $callback, $param1 = null, $param2 = null, $param3 = null)   X-Ref

param: $url
param: $data
param: $callback
param: $param1
param: $param2
param: $param3
return: phpQueryObject

browser($ajaxSettings, $callback, $param1 = null, $param2 = null, $param3 = null)   X-Ref

param: $ajaxSettings
param: $callback
param: $param1
param: $param2
param: $param3
return: phpQueryObject

php($code)   X-Ref

param: $code
return: string

code($type, $code)   X-Ref

param: $type
param: $code
return: string

__callStatic($method, $params)   X-Ref
No description

dataSetupNode($node, $documentID)   X-Ref
No description

dataRemoveNode($node, $documentID)   X-Ref
No description

data($node, $name, $data, $documentID = null)   X-Ref
No description

removeData($node, $name, $documentID)   X-Ref
No description

Class: phpQueryPlugins  - X-Ref

Plugins static namespace class.

__call($method, $args)   X-Ref
No description

pq($arg1, $context = null)   X-Ref
Shortcut to phpQuery::pq($arg1, $context)
Chainable.

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
see: phpQuery::pq()
author: Tobiasz Cudnik <tobiasz.cudnik/gmail.com>