Skip to content

Kirby 4.5.0

$kirby->root('media')

Returns the root of the media folder.

Example

<?= $kirby->root('media') ?>

Custom setup

If you want to overwrite the root you can do this in your index.php by passing a custom roots setup to the Kirby constructor.

/index.php
<?php

include 'kirby/bootstrap.php';

$kirby = new Kirby([
    'roots' => [
        'media' => '/absolute/path/to/custom/root',
    ],
]);

echo $kirby->render();