feat: add Kontaktformular section with backend logic and styles

Implemented a new Kontaktformular section including a frontend form, backend logic using `mzur/kirby-uniform`, and corresponding styles in `input.css`. Added a new template, controller, and snippet for dynamic rendering and form handling.
This commit is contained in:
2025-07-13 16:49:05 +02:00
parent 090ac601a5
commit a3e08f22ed
5 changed files with 166 additions and 1 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
use Uniform\Form;
return function ($kirby)
{
$form = new Form([
'email' => [
'rules' => ['required', 'email'],
'message' => 'Bitte geben Sie eine gültige E-Mail Adresse ein.',
],
'name' => [
'rules' => ['required'],
'message' => 'Bitte geben Sie Ihren Namen ein.',
],
'message' => [
'rules' => ['required'],
'message' => 'Bitte geben Sie eine Nachricht ein.',
],
]);
if ($kirby->request()->is('POST')) {
$form->emailAction([
'to' => [
'info@feigel.it'
],
'from' => 'webmaster@schachfreunde-badsteben.de',
'subject' => 'Kontaktanfrage über die Homepage der Schachfreunde Bad Steben',
])->done();
}
return compact('form');
};