Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A versatile Kirby plugin to handle web form actions.

License

NotificationsYou must be signed in to change notification settings

mzur/kirby-uniform

Repository files navigation

A versatileKirby plugin to handle web form actions.

Documentation StatusTestsKirby >=3

This is Uniform for Kirby >=3. You can find Uniform for Kirby 2 in thekirby-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:

<?phpuseUniform\Form;returnfunction ($kirby) {$form =newForm(['email' => ['rules' => ['required','email'],'message' =>'Email is required',      ],'message' => [],   ]);if ($kirby->request()->is('POST')) {$form->emailAction(['to' =>'me@example.com','from' =>'info@example.com',      ])->done();   }returncompact('form');};

Template:

<form action="<?phpecho$page->url()?>" method="POST">   <input name="email" type="email" value="<?phpecho$form->old('email');?>">   <textarea name="message"><?phpecho$form->old('message');?></textarea><?phpechocsrf_field();?><?phpechohoneypot_field();?>   <input type="submit" value="Submit"></form><?phpif ($form->success()):?>   Success!<?phpelse:?><?phpsnippet('uniform/errors', ['form' =>$form]);?><?phpendif;?>

Installation

Install Uniform via Composer:composer require mzur/kirby-uniform

Ordownload the repository and extract it tosite/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 toRead the Docs.

Questions

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


[8]ページ先頭

©2009-2025 Movatter.jp