$file->prev()

Returns the previous sibling

  • return ($file)

Example

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