You are here

public function Crawler::slice in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/dom-crawler/Crawler.php \Symfony\Component\DomCrawler\Crawler::slice()

Slices the list of nodes by $offset and $length.

Parameters

int $offset:

int $length:

Return value

Crawler A Crawler instance with the sliced nodes

File

vendor/symfony/dom-crawler/Crawler.php, line 371

Class

Crawler
Crawler eases navigation of a list of \DOMElement objects.

Namespace

Symfony\Component\DomCrawler

Code

public function slice($offset = 0, $length = -1) {
  return $this
    ->createSubCrawler(iterator_to_array(new \LimitIterator($this, $offset, $length)));
}