Custom folder structure

Hello, one question for the Kirby development team.

I’ve been experimenting with some cleaner folder structure, primarily for maintenance and future updating, to narrow down the room for error and accidents, like overwriting something not intended, and eventually, I came up with this in index.php

<?php

include __DIR__ . '/kirby/bootstrap.php';

$kirby = new Kirby([
    'roots' => [
        'index'         => __DIR__,
        'blueprints'    => __DIR__ . '/site/theme/blueprints',
        'collections'   => __DIR__ . '/site/theme/collections',
        'controllers'   => __DIR__ . '/site/theme/controllers',
        'models'        => __DIR__ . '/site/theme/models',
        'snippets'      => __DIR__ . '/site/theme/snippets',
        'templates'     => __DIR__ . '/site/theme/templates'
    ]
]);

echo $kirby->render();

Tested it, and haven’t found any issue so far.
My question is simple - is this approach ok?
Can I expect some issues with some functions? Haven’t tested models, hooks, and routes for example.
Also, you know future Kirby path and milestones, does this conflict with something in the near future?

Since you can change all roots freely, this should not cause any issues.

I don’t think so, there are no plans that I know of to have a theme folder.

1 Like

That’s great, @pixelijn, thank you! :muscle: