Create and Validate PHP Forms in Seconds.
GPL-2.0 License
Bot releases are visible (Hide)
Published by timgavin 2 months ago
Full Changelog: https://github.com/formr/formr/compare/1.5.1...1.5.2
Published by timgavin 4 months ago
Full Changelog: https://github.com/formr/formr/compare/1.5.0...1.5.1
mcrypt
functions, and replaced them with modern PHP 8 functions.@tailwindcss/forms
plugin in your tailwind.config.js
file for the wrapper to work properly.lib/wrappers/tailwind.php
.I did not add return types or type hints because the code was written under PHP 5, so adding them would basically kill your app because I did a lousy job of creating the methods and properties back in the day.
The Bootstrap 3 and 4 wrappers have not been updated as they are obsolete.
Published by timgavin 8 months ago
$_SESSION
and checkbox/dropdown arraysPublished by timgavin over 1 year ago
Published by timgavin over 1 year ago
Published by timgavin over 1 year ago
select_multiple()
item being selected when empty$_SESSION
Published by timgavin over 1 year ago
$form->send_email()
$form->info()
Published by timgavin almost 2 years ago
value
attribute to the honeypot method.Published by timgavin over 2 years ago
Added an error()
function to print out inline error messages
$form->text('first_name', 'First name');
$form->error('first_name');
Fixed an issue where hidden elements would not have an ID.
Fixed an issue where changing the name of uploaded files would truncate the filename.
Published by timgavin over 2 years ago
You can now add custom headers to your HTML emails when using send_email()
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: " . $from . "\r\n";
$form->send_email($to, $subject, $message, $from, 'HTML', $headers);
You can now set a timeout duration for CSRF in FastForm.
// Set the CSRF timeout to 1800 seconds
$form->fastform($data, 1800);
SESSION
expired.Published by timgavin over 2 years ago
Bug fixes
Published by timgavin over 2 years ago
Misc. bug fixes.
Published by timgavin over 2 years ago
Finally! Error messages will now appear under each form element if $form->inline_errors
is set to TRUE
.
Added a cURL option for use with reCAPTCHA.
Fixed an issue with date
and datetime
validation.
Published by timgavin almost 3 years ago
Formr now defaults to Bootstrap 5 when instantiating Formr with the 'Bootstrap' parameter.
$form = new \Formr\Formr('bootstrap'); // defaults to Bootstrap 5
Formr no longer uses FILTER_SANITIZE_STRING
in the sanitize_string
validation rule as it's been depreciated in PHP 8. The rule now uses strip_tags()
.
Added a nowrap
switch to remove bootstrap and bulma element <div>
wrappers.
$form = new \Formr\Formr('bootstrap', 'nowrap');
Added a honeypot
method for inserting a honeypot into the form.
$form->honeypot('company_name');
Fixed an issue where Formr would not add the default Bootstrap or Bulma element class (e.g.; form-control
) when adding custom classes to an element.
Fixed an issue where inline help text was not properly displayed when using Bootstrap 5.
Removed (int)
casting from some validation methods as it was preventing the use of floats.
Fixed an issue where 0 (zero) would not work in the greater_than_or_equal
validation rule.
Published by timgavin about 3 years ago
Implemented basic support for Bootstrap 5
$form = new \Formr\Formr('bootstrap5');
Made open elements self-closing, e.g.; />
.
Fixed an issue with Bulma checkboxes not appearing inline.
Published by timgavin about 3 years ago
Added ability to change messages()
error message heading text
$form->error_heading_plural = 'Please Correct the Following Errors';
$form->error_heading_singular = 'Please Correct the Following Error';
Updated redirect()
method and added a default value for redirecting to the same page, plus added exit
after the redirect.
Fixed an issue where flash messages would not print properly in hush mode.
Published by timgavin about 3 years ago
Added Fieldsets to FastForm
$data = [
'fieldset1' => [
'legend' => 'Name & Email',
'fields' => [
'text1' => 'name,Name',
'email' => 'email,Email',
],
],
'fieldset2' => [
'legend' => 'Address',
'fields' => [
'text2' => 'address,Address',
'text3' => 'city,City',
'select' => 'state,State,,,,,,states',
'number' => 'zip,Zip',
],
],
'textarea' => 'comments,Comments'
];
$form->fastform($data);
Published by timgavin over 3 years ago
Added $form->recaptcha_action_name
to the reCAPTCHA JavaScript so you can differentiate forms via actions in the reCAPTCHA Admin panel.
Added a new clear()
method to empty the $_POST
super global after a form submission.
if($form->submitted())
{
$name = $form->post('name');
$email = $form->post('email');
if($form->ok()) {
$form->clear();
}
}
Fixed an issue with FastForm arrays not handling hidden elements properly (based off of 81c4dc7e07f2727073c871891a8b1e934714a446)
Removed <fieldset>
from FastForm
Cleaned up some code
Published by timgavin over 3 years ago
Added support for Google reCAPTCHA v3. ReCheck out the blog post for more info.
It's easier than ever to work with multiple forms on one page. You no longer have to add hidden fields and check if they were submitted, Formr will now do this automatically. Check out the blog post to see how.
You can now add your validation rules as an array!
if($form->submitted()) {
$name = $form->post('name', '', ['min[3]', 'max[60]', 'not_regex[/foo|bar/]']);
}
Added a required
validation rule (how did I overlook this?!).
Fixed an issue with labels not working properly in FastForm.