1. Go to this page and download the library: Download arnoson/kirby-forms library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arnoson / kirby-forms example snippets
snippet('form');
'arnoson.kirby-forms' => [
// A list of email addresses that can be selected in the panel as the sender
// of confirmation and notification emails.
'fromEmails' => [],
// Wether or not to use client validation (in addition to server-side
// validation done by Kirby Uniform).
'clientValidation' => true,
// How many columns to use for the grid that determines the layout of the
// form. see: https://getkirby.com/docs/reference/panel/fields/layout#calculate-the-column-span-value
'gridColumns' => 12,
// Wether or not to use the `autocomplete` attribute for the form element.
'autoComplete' => false,
// Automatically add an empty placeholder to fields without a defined
// placeholder in the panel. This is useful for css styling relying on
// `input:placeholder-shown`.
'addEmptyPlaceholder' => false,
// When using the brevo action.
// Note: do not hardcode your API key, use an .env file instead.
'brevoApiKey' => '1234',
]
// site/models/form.php
// Define your own action or use any Kirby Uniform action instead.
class MyAction extends Uniform\Actions\Action {
public function perform() {
$page = $this->option('page');
$form = $this->form;
// Do something with the form or form page ...
}
}
class FormPage extends Kirby\Cms\Page {
public function actions() {
return [MyAction::class];
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.