Skip to content

Kirby 5.0.2

$pages->append()

Appends an element to the data array

$pages->append(string|Kirby\Cms\Page ...$args): Kirby\Cms\Pages

Parameters

Name Type Default
...$args stringorKirby\Cms\Page no default value

Return type

Kirby\Cms\Pages

This method modifies the existing $ object it is applied to and returns it again.

Parent class

Kirby\Cms\Pages inherited from Kirby\Cms\Collection

Examples

$collection = page('projects')->children()->limit(1);

foreach(page('projects')->children()->offset(1) as $key => $child) {
  $collection->append($key, $child);
}