Skip to content
Kirby CMS
Kirby
3.9.8
The CMS
For developers
For designers
For content creators
For clients & agencies
Showcase
Releases
Docs
Guide
Cookbook
Reference
Screencasts
Glossary
Resources
Plugins
Themes
Newsletter
Buzz
Community
Feedback
Support forum
Discord chat
Mastodon
Instagram
Partners
Try
Love
Buy
Search
Search
Reference
All pages
Guide
Reference
Cookbook
Plugin
Kosmos
Reference
$pages
Close
Text
KirbyText
Markdown
Templates
Field methods
Helpers
Panel
Blueprints
Fields
Sections
Blocks
Icons
Styling
Samples
Objects
$kirby
$site
$page
$pages
$file
$files
$user
$users
$block
$blocks
$layout
$layouts
$language
$languages
$pagination
$request
$session
All classes
Aliases
Router
Patterns
Response types
System
Options
Urls
Roots
Validators
Plugins
Extensions
Hooks
Core components
UI Kit
Panel internals
API
Authentication
Languages
Pages
Roles
Site
System
Translations
Users
Tools
A
Cookie
Data
Dir
Escape
F
Header
Html
I18n
Mime
Query
Str
Tpl
Url
V
Xml
new Pages()
Creates a new Collection with the given objects
$pages->add()
Adds a single page or an entire second collection to the current collection
$pages->append()
Appends an element to the data array
$pages->audio()
Returns all audio files of all children
$pages->children()
Returns all children for each page in the array
$pages->chunk()
Creates chunks of the same size.
$pages->clone()
Returns a cloned instance of the collection
$pages->code()
Returns all code files of all children
$pages->count()
Counts all elements
$pages->current()
Returns the current element
$pages->data()
Getter and setter for the data
$pages->documents()
Returns all documents of all children
$pages->drafts()
Fetch all drafts for all pages in the collection
$pages->empty()
Clone and remove all elements from the collection
$pages->extend()
Adds all elements to the collection
Pages::factory()
Creates a pages collection from an array of props
$pages->files()
Returns all files of all children
$pages->filter()
Filters elements by one of the predefined filter methods, by a custom filter function or an array of filters
$pages->filterBy()
Alias for Kirby\Toolkit\Collection::filter
$pages->find()
Find one or multiple elements by id
$pages->findBy()
Find a single element by an attribute and its value
$pages->findOpen()
Finds the currently open page
$pages->first()
Returns the first element
$pages->flip()
Returns the elements in reverse order
$pages->get()
Custom getter that is able to find extension pages
$pages->getAttribute()
Extracts an attribute value from the given element in the collection. This is useful if elements in the collection might be objects, arrays or anything else and you need to get the value independently from that. We use it for filter.
$pages->getIterator()
Get an iterator for the items.
$pages->group()
Groups the items by a given field or callback. Returns a collection with an item for each group and a collection for each group.
$pages->groupBy()
Alias for Kirby\Toolkit\Collection::group
$pages->has()
Checks if the given object or id is in the collection
$pages->images()
Returns all images of all children
$pages->index()
Create a recursive flat index of all pages and subpages, etc.
$pages->indexOf()
Correct position detection for objects.
$pages->intersection()
Returns a Collection with the intersection of the given elements
$pages->intersects()
Checks if there is an intersection between the given collection and this collection
$pages->isEmpty()
Checks if the number of elements is zero
$pages->isEven()
Checks if the number of elements is even
$pages->isNotEmpty()
Checks if the number of elements is more than zero
$pages->isOdd()
Checks if the number of elements is odd
$pages->key()
Returns the current key
$pages->keyOf()
Tries to find the key for the given element
$pages->keys()
Returns an array of all keys
$pages->last()
Returns the last element
$pages->limit()
Returns a new object with a limited number of elements
$pages->listed()
Returns all listed pages in the collection
$pages->map()
Map a function to each element
$pages->merge()
Include all given items in the collection
$pages->next()
Moves the cursor to the next element and returns it
$pages->not()
Returns a Collection without the given element(s)
$pages->notTemplate()
Filter all pages by excluding the given template
$pages->nth()
Returns the nth element from the collection
$pages->nums()
Returns an array with all page numbers
$pages->offset()
Returns a new object starting from the given offset
$pages->paginate()
Add pagination and return a sliced set of data.
$pages->pagination()
Get the previously added pagination object
$pages->parent()
Returns the parent model
$pages->pluck()
Extracts all values for a single field into a new array
$pages->prepend()
Prepends an element to the data array
$pages->prev()
Moves the cursor to the previous element and returns it
$pages->published()
$pages->query()
Runs a combination of filter, sort, not, offset, limit, search and paginate on the collection.
$pages->random()
Returns a new collection consisting of random elements, from the original collection, shuffled or ordered
$pages->remove()
Removes an object
$pages->rewind()
Moves the cursor to the first element
$pages->search()
Searches the collection
$pages->set()
Adds a new element to the collection
$pages->shuffle()
Shuffle all elements
$pages->slice()
Returns a slice of the object
$pages->sort()
Sorts the elements by any number of fields
Pages::sortArgs()
Get sort arguments from a string
$pages->sortBy()
Alias for Kirby\Toolkit\Collection::sort
$pages->template()
Filter all pages by the given template
$pages->toArray()
Converts all objects in the collection to an array. This can also take a callback function to further modify the array result.
$pages->toJson()
Converts the object into a JSON string
$pages->toString()
Converts the object to a string
$pages->unlisted()
Returns all unlisted pages in the collection
$pages->valid()
Checks if the current element is valid
$pages->values()
Returns a non-associative array with all values. If a mapping Closure is passed, all values are processed by the Closure.
$pages->videos()
Returns all video files of all children
$pages->when()
The when method only executes the given Closure when the first parameter is true. If the first parameter is false, the Closure will not be executed.
$pages->without()
Alias for $this->not()
$pages->published()
kirby/src/Cms/Pages.php#L484
$pages->published()
Parent class
Kirby\Cms\Pages