Skip to content

Kirby 3.5.7.1

$page->sort()

Deprecated in 3.5.0
Use Page::changeSort() instead
$page->sort(null $position = null): Kirby\Cms\Page

Parameters

Name Type Default
$position null null

Return type

Kirby\Cms\Page

This method does not modify the existing $page object but returns a new object with the changes applied. Learn more →

Parent class

Kirby\Cms\Page

Example

try {

  page('invisible-page')->sort(12);
  echo 'The page is now visible and has the sorting number 12';

} catch(Exception $e) {

  echo $e->getMessage();

}

No parameter

If the parameter $num is not specified, the result of `$page->num() will be returned instead.