Download the PHP package helmut/forms without Composer
On this page you can find all versions of the php package helmut/forms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package forms
Helmut\Forms
A customisable and testable form abstraction library. Think of it as a request model on steroids. We all handle forms in different ways. Forms reduces the complexity and allows you focus on design. Use the included default fields, or build up your own library of reusable and testable fields, and drop them into every application you build.
- Makes forms testable
- Abstracts the request not the html
- Provides a model for reusing field components
- Design fields exactly the same way you normally would
- Render using mustache, twig, or blade
- Built in validation
Documentation
- Installation
- Usage
- API Reference
- Field Types
- Button
- Text
- Name
- Number
- Password
- Paragraph Text
- Checkbox
- Checkboxes
- Dropdown
- Search
- Customisation
- Templates
- Language
- Plugins
- Autoloading
- Security
- License
Installation
To get the latest version of Forms, simply require the project using Composer:
Instead, you may of course manually update your require block and run composer update
if you so choose:
If you are using Laravel you need to register the service provider. Open up config/app.php
and add the Helmut\Forms\Providers\Laravel::class
key to the providers
array.
Usage
Step 1
Create a class that extends \Helmut\Forms\Form
.
Step 2
Now you can create a form.
Or in Laravel, simply type hint route or controller methods.
Step 2
Define fields to build the form.
Or alternatively you can create a class just for this specific form that extends \App\Forms\Form
. Then fields can be defined within a define
method and they will be added automatically.
Step 4
You can now render the form and handle submissions.
Or in Laravel:
Step 6
Check out the form!
API Reference
These methods allow you to interact with your form:
Field Types
These field types have been included by default:
button
Example:
$form->button('signup')->label('Sign Up');
text
Validations: between(min, max)
, min(num)
, max(num)
, alpha
, alpha_num
, alpha_dash
, in(array)
, not_in(array)
Example:
$form->text('address')->label('Address')->required();
name
Example:
$form->name('name')->label('Name')->required();
Example:
$form->email('email')->label('Email Address')->required();
number
Validations: between(min, max)
, min(num)
, max(num)
, integer
, in(array)
, not_in(array)
Example:
$form->number('age')->label('Age')->integer()->min(18)->required();
password
Example:
$form->password('password')->label('Password')->required();
paragraph_text
Example:
$form->paragraph_text('comments')->label('Comments');
checkbox
Example:
$form->checkbox('subscribe')->label('Subscribe to our newsletter');
checkboxes
Example:
$form->checkboxes('interests')->label('Interests')->options(['golf' => 'Golf', 'swimming' => 'Swimming', 'dancing' => 'Dancing', 'reading' => 'Reading'])->required();
dropdown
Example:
$form->dropdown('colour')->label('Colour')->options(['red' => 'Red', 'green' => 'Green', 'blue' => 'Blue']);
search
Example:
$form->search('search');
Customisation
Forms was designed as a framework upon which developers can build a library of modules to simplify the repetitive task of processing complex requests. A basic set of fields and templates are included, however the expectation is that you will use those as a starting point for customisation. By rolling your own, you can design, build and test them once, and drop them into any application.
- Creating fields
- Creating templates
- Creating plugins
Templates
A few basic template packages are provided by default that are compatible with common css frameworks such as Bootstrap and Foundation. These should provide a great base for Neat are in the pipeline.
Languages
Plugins
Security
If you discover any security related issues, please email helmut.github [at] gmail.com instead of using the issue tracker. All security vulnerabilities will be promptly addressed.
License
The MIT License (MIT). Please see License File for more information.