2017 © Pedro Peláez
 

library form

Form component for Palmtree PHP

image

palmtree/form

Form component for Palmtree PHP

  • Monday, June 25, 2018
  • by palmtree
  • Repository
  • 1 Watchers
  • 3 Stars
  • 121 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 33 Versions
  • 4 % Grown

The README.md

:palm_tree: Palmtree Form

License Build Packagist Version npm version, (*1)

PHP form builder with Bootstrap classes, validation, data binding, Google Recaptcha and hCaptcha support, plus other goodies., (*2)

Requirements

  • PHP >= 8.1

Installation

Use composer to add the package to your dependencies:, (*3)

composer require palmtree/form

Optional: Install the NPM package for AJAX form submission, CAPTCHA support and form collections:, (*4)

npm install @palmtree/form

Usage Example

Build

use Palmtree\Form\FormBuilder;
use Palmtree\Form\Captcha\GoogleRecaptcha;
use Palmtree\Form\Captcha\HCaptcha;

$builder = (new FormBuilder('my_form'))
    ->add('name', 'text', ['error_message' => 'Please enter your name'])
    ->add('email_address', 'email', [
        'help' => 'We will never share your email with anyone',
    ])
    ->add('message', 'textarea', [
        'required' => false,
        'label' => 'Enter your message',
    ])
    ->add('recaptcha', 'captcha', [
        'captcha' => new GoogleRecaptcha('<site_key>', '<secret>'),
        //'captcha' => new HCaptcha('<site_key>', '<secret>'),
    ]);

$builder->add('send_message', 'submit');

$form = $builder->getForm();
// Set $form to some variable accessible in a view

Render




= $form->render(); ?>

Process

$form->handleRequest();

if ($form->isSubmitted() && $form->isValid()) {
    // Send an email/save to database etc
    $name = $form->get('name')->getData();
}

See the examples directory for examples using AJAX, file uploads, collections and more., (*5)

Documentation

View the documentation for more advanced usage., (*6)

Examples

The simplest way to run the examples is run the serve.sh script. This script starts a small PHP Docker container and serves the examples using PHP's built-in web server., (*7)

./examples/serve.sh

License

Released under the MIT license, (*8)

The Versions

25/06 2018

dev-master

9999999-dev

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

by andyexeter

25/06 2018

dev-dev

dev-dev

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

25/06 2018

v0.12.0

0.12.0.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

11/11 2017

v0.11.0

0.11.0.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

11/11 2017

v0.10.5

0.10.5.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

11/11 2017

v0.10.4

0.10.4.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

11/11 2017

v0.10.3

0.10.3.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

09/11 2017

v0.10.2

0.10.2.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

09/11 2017

v0.10.1

0.10.1.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

09/11 2017

v0.10.0

0.10.0.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

02/11 2017

v0.9.0

0.9.0.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

09/07 2017

v0.8.8

0.8.8.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

09/07 2017

v0.8.7

0.8.7.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

22/06 2017

v0.8.6

0.8.6.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

22/06 2017

v0.8.5

0.8.5.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

22/06 2017

v0.8.4

0.8.4.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

22/06 2017

v0.8.3

0.8.3.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

22/06 2017

v0.8.2

0.8.2.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

22/06 2017

v0.8.1

0.8.1.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

11/06 2017

v0.8.0

0.8.0.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

05/06 2017

v0.7.1

0.7.1.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

03/05 2017

v0.7.0

0.7.0.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

03/05 2017

v0.6.10

0.6.10.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

03/05 2017

v0.6.9

0.6.9.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

24/04 2017

v0.6.8

0.6.8.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

20/04 2017

v0.6.7

0.6.7.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

12/04 2017

v0.6.6

0.6.6.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

12/04 2017

v0.6.5

0.6.5.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

12/04 2017

v0.6.4

0.6.4.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

12/04 2017

v0.6.3

0.6.3.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

12/04 2017

v0.6.2

0.6.2.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

12/04 2017

v0.6.1

0.6.1.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

25/10 2016

0.5.1

0.5.1.0

Form component for Palmtree PHP

  Sources   Download

MIT

The Requires

 

by andyexeter