Skip to content


Creates a files collection from an array of props

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


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


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

Parent class