svenkrefeld/symfony-kirby-bundle

Integrates Kirby CMS into Symfony as a fallback router

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

Type:symfony-bundle

pkg:composer/svenkrefeld/symfony-kirby-bundle

v1.0.0 2026-02-02 23:38 UTC

This package is auto-updated.

Last update: 2026-02-03 00:15:55 UTC


README

Integrates Kirby CMS into Symfony as a fallback router. Symfony routes have priority, unmatched routes are handled by Kirby.

Requirements

  • PHP 8.2+
  • Symfony 7.4+
  • Kirby CMS 5.2+

Installation

Symfony's default composer.json contains a replace section for polyfills that conflicts with Kirby. These polyfills are not needed anyway since PHP 8.2 is the minimum requirement. Update it to only keep ctype and iconv:

{
    "replace": {
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*"
    }
}

Then install:

composer require svenkrefeld/symfony-kirby-bundle

Configuration

1. Import routes

# config/routes/symfony_kirby.yaml
symfony_kirby:
    resource: '@SymfonyKirbyBundle/config/routes.php'

2. Configure paths (optional)

# config/packages/symfony_kirby.yaml
symfony_kirby:
    roots:
        content: '%kernel.project_dir%/content'
        site: '%kernel.project_dir%/site'
        storage: '%kernel.project_dir%/var/kirby'

3. Security firewall

# config/packages/security.yaml
security:
    firewalls:
        kirby:
            pattern: ^/(panel|api|media)/
            security: false
        # ... other firewalls

4. Create directories

mkdir -p content/home
mkdir -p site/{blueprints/pages,config,snippets,templates}
mkdir -p var/kirby/{accounts,cache,sessions}

5. Add to .gitignore

###> getkirby/cms ###
/public/media/
/var/kirby/
###< getkirby/cms ###

Kirby Configuration

Create site/config/config.php:

<?php

return [
    'debug' => ($_ENV['APP_ENV'] ?? 'prod') === 'dev',
    'panel' => [
        'install' => true, // Set to false in production
    ],
];

Routing Behavior

URL Handler
Symfony routes Symfony (priority)
/panel/* Kirby Panel
/api/* Kirby API
/media/* Kirby Media
Everything else Kirby (fallback)

License

MIT