hksagentur/kirby-webform
最新稳定版本:3.0.0
Composer 安装命令:
composer require hksagentur/kirby-webform
包简介
Easily create and manage webforms in Kirby
README 文档
README
Easily create and manage webforms in Kirby, heavily inspired by Filament Forms.
Requirements
Kirby CMS (>=3.10)
PHP (>= 8.2)
Installation
Composer
composer require hksagentur/kirby-webform
Download
Download the project archive and copy the files to the plugin directory of your kirby installation. By default this directory is located at /site/plugins.
Configuration
Add a configuration file for a new form in site/forms.
<?php // site/forms/contact.php use Webform\Action\Email; use Webform\Form\Components\Button; use Webform\Form\Components\TextInput; use Webform\Form\Components\Textarea; use Webform\Form\Form; return Form::create()->children([ TextInput::create('name') ->required(), TextInput::create('email') ->required() ->email(), Textarea::create('message') ->required() ->maxLength(255) ->rows(8), Button::create('submit') ->action(fn (FormSubmission $submission) => Email::create('contact') ->subject('Contact Form') ->from('no-reply@example.com') ->to('info@example.org') ->execute($submission) ), ]);
FAQ
How can I customize the directory from which the form configuration is read?
You can provide a custom directory via Kirby’s `roots` structure. Open the `index.php` and adjust the initialization of the kirby core:<?php // index.php require __DIR__ . '/kirby/bootstrap.php'; $kirby = new Kirby([ 'roots' => [ 'webforms' => dirname(__DIR__) . '/site/webforms', ], ]); echo $kirby->render();
License
ISC License. Please see License File for more information.
统计信息
- 总下载量: 56
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: ISC
- 更新时间: 2026-04-08