$file->prev()

Returns the previous sibling

  • return ($file)

Example

if($prev = $page->file('myfile.pdf')->prev()) {
  echo 'Previous file: ' . $prev->filename();
}

Is something missing or incorrect? Edit this page on Github…