form kirby kirby-plugin PHP
Need help with kirby-uniform?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
mzur

Description

A versatile Kirby plugin to handle web form actions.

212 Stars 31 Forks GNU General Public License v2.0 336 Commits 1 Opened issues

Services available

Need anything else?

Kirby Uniform

A versatile Kirby plugin to handle web form actions.

Documentation Status Build Status Kirby 3

This is Uniform for Kirby 3. You can find Uniform for Kirby 2 in the kirby-2 branch.

Builtin actions:

  • Email: Send the form data by email.
  • EmailSelect: Choose from multiple recipients to send the form data by email.
  • Log: Log the form data to a file.
  • Login: Log in to the Kirby frontend.
  • SessionStore: Store the form in the user's session.
  • Upload: Handle file uploads.
  • Webhook: Send the form data as an HTTP request to a webhook.

Quick example

Controller:

return function ($kirby) {
   $form = new Form([
      'email' => [
         'rules' => ['required', 'email'],
         'message' => 'Email is required',
      ],
      'message' => [],
   ]);

if ($kirby->request()->is('POST')) { $form->emailAction([ 'to' => '[email protected]', 'from' => '[email protected]', ]); }

return compact('form'); };

Template:


   
   <?php echo $form->old('message'); ?>
   
   
   

success()): ?>
   Success!

    $form]); ?>


Installation

Install Uniform via Composer:

composer require mzur/kirby-uniform:^4.0

Or download the repository and extract it to

site/plugins/uniform
.

Setup

Add this to your CSS:

.uniform__potty {
    position: absolute;
    left: -9999px;
}

Note: Disable the Kirby 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.

Questions

See the answers in the docs, post an issue if you think it is a bug or create a topic in the forum 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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.