https://github.com/mzur/kirby-uniform
A versatile Kirby plugin to handle web form actions.
https://github.com/mzur/kirby-uniform
form kirby kirby-plugin php
Last synced: about 1 year ago
JSON representation
A versatile Kirby plugin to handle web form actions.
- Host: GitHub
- URL: https://github.com/mzur/kirby-uniform
- Owner: mzur
- License: mit
- Created: 2014-11-09T17:46:35.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T13:05:18.000Z (about 2 years ago)
- Last Synced: 2025-04-02T06:13:01.708Z (over 1 year ago)
- Topics: form, kirby, kirby-plugin, php
- Language: PHP
- Homepage: https://kirby-uniform.readthedocs.io
- Size: 799 KB
- Stars: 254
- Watchers: 12
- Forks: 39
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Kirby Uniform
A versatile [Kirby](http://getkirby.com) plugin to handle web form actions.
[](https://kirby-uniform.readthedocs.io/en/latest/?badge=latest) [](https://github.com/mzur/kirby-uniform/actions/workflows/php.yml) 
This is Uniform for Kirby >=3. You can find Uniform for Kirby 2 in the [kirby-2 branch](https://github.com/mzur/kirby-uniform/tree/kirby-2).
Builtin actions:
- [Email](https://kirby-uniform.readthedocs.io/en/latest/actions/email/): Send the form data by email.
- [EmailSelect](https://kirby-uniform.readthedocs.io/en/latest/actions/email-select/): Choose from multiple recipients to send the form data by email.
- [Log](https://kirby-uniform.readthedocs.io/en/latest/actions/log/): Log the form data to a file.
- [Login](https://kirby-uniform.readthedocs.io/en/latest/actions/login/): Log in to the Kirby frontend.
- [SessionStore](https://kirby-uniform.readthedocs.io/en/latest/actions/session-store): Store the form in the user's session.
- [Upload](https://kirby-uniform.readthedocs.io/en/latest/actions/upload): Handle file uploads.
- [Webhook](https://kirby-uniform.readthedocs.io/en/latest/actions/webhook/): Send the form data as an HTTP request to a webhook.
## Quick example
Controller:
```php
[
'rules' => ['required', 'email'],
'message' => 'Email is required',
],
'message' => [],
]);
if ($kirby->request()->is('POST')) {
$form->emailAction([
'to' => 'me@example.com',
'from' => 'info@example.com',
])->done();
}
return compact('form');
};
```
Template:
```html+php
old('message'); ?>
success()): ?>
Success!
$form]); ?>
```
## Installation
Install Uniform via Composer: `composer require mzur/kirby-uniform`
Or [download](https://github.com/mzur/kirby-uniform/archive/master.zip) the repository and extract it to `site/plugins/uniform`.
## Setup
Add this to your CSS:
```css
.uniform__potty {
position: absolute;
left: -9999px;
}
```
**Note:** [Disable the Kirby cache](https://getkirby.com/docs/guide/cache) for pages where you use Uniform to make sure the form is generated dynamically.
## Documentation
For the full documentation head over to [Read the Docs](https://kirby-uniform.readthedocs.io).
## Questions
See the [answers](https://kirby-uniform.readthedocs.io/en/latest/answers/) in the docs, [post an issue](https://github.com/mzur/kirby-uniform/issues) if you think it is a bug or create a topic in [the forum](https://forum.getkirby.com/) if you need help.
## Contributing
Contributions are always welcome!
## Donations
Since some people insist on sending me money for this (free) plugin you can do this [here](https://www.paypal.me/mzur/10eur).