Skip to content

Kirby 4.4.1

$file->root()

Returns the absolute root to the file

$file->root(): string|null

Return type

string|null

Parent class

Kirby\Cms\File

Example

if($file = $page->file()):
    echo $file->root();
    // i.e. /var/www/yourdomain.com/html/content/some-page/some-file.jpg
endif;