Skip to content

Kirby 3.9.8

Files::factory()

Creates a files collection from an array of props

Files::factory(array $files, Kirby\Cms\Model $parent): Kirby\Cms\Files

Parameters

Name Type Default
$files * array
$parent * Kirby\Cms\Model

The $files parameter is an array of Kirby\Cms\File objects or an array of arrays, where each array contains the properties to create a Kirby\Cms\File object. Pass the following data for each file:

Name Type Description
blueprint array Sets the Blueprint object
content array Sets the Content object
filename * string Sets the filename
parent * Kirby\Cms\Model Sets the parent model object
root string Always set the root to null, to invoke
auto root detection
template string
translations array Create the translations collection from an array
url string Sets the url

Return type

Kirby\Cms\Files

Parent class

Kirby\Cms\Files