2017 © Pedro Peláez
 

project forms

image

jarzon/forms

  • Friday, July 13, 2018
  • by Jarzon
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 10 Open issues
  • 22 Versions
  • 11 % Grown

The README.md

Form

Install

composer require jarzon/form

Usage

Build the form, (*1)

text('name')
  ->min(2)
  ->max(100)
  ->required()
  ->placeholder('Joe Doe')

  ->number('age')
  ->min(0)
  ->max(100)
  
  ->submit();
```

Show the form in the view
```php
=$form('form')->html?>

    <div><?=$form('name')->label('Name:')->row?></div>

    <div><?=$form('age')->label('Age:')->row?></div>

    <?=$form('submit')->value('Save')->html?>

=$form('/form')->html?>

Process the form values, (*2)

<?php
// On submit validate the form values
if($form->submitted()) {
    try {
        // Does the validation based on the inputs types, min/max, required
        if($values = $form->validation()) {
            // Do what you want with the returned values
            echo "Your name is {$values['name']}";
        }
    }
    catch (\Jarzon\Form\ValidationException $e) {
        // ->validation() throw a custom Exception if there is an invalid value
        echo "Error: {$e->getMessage()}";
    }
}

The Versions

13/07 2018

dev-master

9999999-dev

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

13/07 2018

v1.3.6

1.3.6.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

12/07 2018

v1.3.5

1.3.5.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

12/07 2018

v0.1.3.5

0.1.3.5

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

10/06 2018

v1.3.4

1.3.4.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

08/06 2018

v1.3.3

1.3.3.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

07/06 2018

v1.3.2

1.3.2.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

02/06 2018

v1.3.1

1.3.1.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

02/06 2018

v1.3.0

1.3.0.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

31/05 2018

v1.2.1

1.2.1.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

31/05 2018

v1.2.0

1.2.0.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

31/05 2018

v1.1.0

1.1.0.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

30/05 2018

v1.0.0

1.0.0.0

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

30/05 2018

dev-InputCollection

dev-InputCollection

  Sources   Download

The Requires

  • php >=7.2.0

 

The Development Requires

28/05 2018

v0.1.7

0.1.7.0

  Sources   Download

The Development Requires

18/05 2018

v0.1.6

0.1.6.0

  Sources   Download

The Development Requires

25/04 2018

v0.1.5

0.1.5.0

  Sources   Download

The Development Requires

23/04 2018

v0.1.4

0.1.4.0

  Sources   Download

The Development Requires

23/04 2018

v0.1.3

0.1.3.0

  Sources   Download

The Development Requires

16/04 2018

v0.1.2

0.1.2.0

  Sources   Download

The Development Requires

25/03 2018

v0.1.1

0.1.1.0

  Sources   Download

The Development Requires

01/02 2018

v0.1.0

0.1.0.0

  Sources   Download

The Development Requires