You are here

public function QueryPath::after in QueryPath 6

Same name and namespace in other branches
  1. 7.3 QueryPath/QueryPath.php \QueryPath::after()
  2. 7.2 QueryPath/QueryPath.php \QueryPath::after()
1 call to QueryPath::after()
QueryPath::textAfter in QueryPath/QueryPath.php

File

QueryPath/QueryPath.php, line 710

Class

QueryPath

Code

public function after($data) {
  $data = $this
    ->prepareInsert($data);
  foreach ($this->matches as $m) {
    $ins = $data
      ->cloneNode(TRUE);
    if (isset($m->nextSibling)) {
      $m->parentNode
        ->insertBefore($ins, $m->nextSibling);
    }
    else {
      $m->parentNode
        ->appendChild($ins);
    }
  }
  return $this;
}