svenkrefeld/symfony-kirby-bundle
最新稳定版本:v1.0.0
Composer 安装命令:
composer require svenkrefeld/symfony-kirby-bundle
包简介
Integrates Kirby CMS into Symfony as a fallback router
README 文档
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
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-02