prepend() public method

The markup will be inserted into each match in the set.
See also: append()
See also: before()
See also: after()
See also: prependTo()
public prepend ( mixed $data )
$data mixed This can be either a string (the usual case), or a DOM Element.
示例#1
0
 /**
  * Take all nodes in the current object and prepend them to the children nodes of
  * each matched node in the passed-in DOMQuery object.
  *
  * This will iterate through each item in the current DOMQuery object and
  * add each item to the beginning of the children of each element in the
  * passed-in DOMQuery object.
  *
  * @see insertBefore()
  * @see insertAfter()
  * @see prepend()
  * @see appendTo()
  * @param DOMQuery $dest
  *  The destination DOMQuery object.
  * @retval object DOMQuery
  *  The original DOMQuery, unmodified. NOT the destination DOMQuery.
  * @throws QueryPath::Exception
  *  Thrown if $data is an unsupported object type.
  */
 public function prependTo(DOMQuery $dest)
 {
     foreach ($this->matches as $m) {
         $dest->prepend($m);
     }
     return $this;
 }