[ 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: 5704 lines (209 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 10 classes

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

DOMDocumentWrapper:: (35 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()
  trigger()
  add()
  remove()
  getNode()
  setNode()
  issetGlobal()

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

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

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

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

CallbackParameterToReference:: (1 method):
  __construct()

CallbackParam:: (0 methods):

phpQueryObject:: (215 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()
  dumpTreeInternal()
  dumpDie()
  mb_internal_encoding()
  mb_regex_encoding()
  mb_strlen()
  mb_strpos()
  mb_stripos()
  mb_substr()
  mb_substr_count()
  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

return: array contentType, charset
param: $markup

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.

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

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

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

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

return: DOMDocumentWrapper
param: $source

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

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

documentFragmentToMarkup($fragment)   X-Ref
No description

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

return: string
param: $nodes    DOMNode|DOMNodeList

markupFixXHTML($markup)   X-Ref
No description

debug($text)   X-Ref
No description

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

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

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: 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

return: unknown_type
param: $attr

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

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

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>

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

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.

return: bool
param: string $char

parseSelector($query)   X-Ref


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

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

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

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

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

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

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")
return: boolean
param: unknown_type $class
param: unknown_type $node

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
No description

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

return: unknown_type
param: $value

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

return: unknown_type
param: $html

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.

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

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.

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

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.

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

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

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

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...

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

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

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

___wrapAllCallback($node)   X-Ref

return: unknown_type
param: $node

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

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

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

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

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

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

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

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

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

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

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...

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

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

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

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

return: unknown_type
param: $markup

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

return: unknown_type
param: $markup

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

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

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...

return: unknown_type
param: $code

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

return: unknown_type
param: $code

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...

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

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.

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

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

return: Int

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

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

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.

return: unknown_type
param: $class
param: $file

__call($method, $args)   X-Ref

return: unknown_type
param: $method
param: $args

_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...

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

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...

return: bool
param: string  $className

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...

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery
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...

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.

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

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.

return: string
param: unknown_type $oneNode

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

dumpTreeInternal($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.

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)

return: phpQueryObject|QueryTemplatesSource|QueryTemplatesParse|QueryTemplatesSourceQuery|QueryTemplatesPhpQuery|false
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)

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.

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

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

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

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

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

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

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

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

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

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

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

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.

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

newDocumentFile($file, $contentType = null)   X-Ref
No description

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

return: string
param: phpQuery|string $content

DOMNodeListToArray($DOMNodeList)   X-Ref
No description

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

return: Bool
param: String $input

debug($text)   X-Ref
No description

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

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

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.

return: string
param: mixed $data

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

return: mixed
param: string $json

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

return: string
param: $source DOMNode|phpQueryObject

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

return: string
param: $source DOMNode|phpQueryObject|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

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

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

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

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

param: array $one
param: array $two

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

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

unique($array)   X-Ref
No description

isFunction($function)   X-Ref

return: unknown_type
param: $function

trim($str)   X-Ref
No description

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

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

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

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

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

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

php($code)   X-Ref

return: string
param: $code

code($type, $code)   X-Ref

return: string
param: $type
param: $code

__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.

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