$pages->sortBy($field, $direction = 'desc', $method = SORT_REGULAR)

Returns a sorted version of the collection.

Example

<ul>
  <?php foreach($page->children()->sortBy('title', 'desc') as $subpage): ?>
  <li>
    <a href="<?php echo $subpage->url() ?>">
      <?php echo html($subpage->title()) ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>