Download the PHP package chtombleson/formster without Composer
On this page you can find all versions of the php package chtombleson/formster. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download chtombleson/formster
More information about chtombleson/formster
Files in chtombleson/formster
Download chtombleson/formster
More information about chtombleson/formster
Files in chtombleson/formster
Vendor chtombleson
Package formster
Short Description Form generation and validation library
License MIT
Package formster
Short Description Form generation and validation library
License MIT
Please rate this library. Is it a good library?
Informations about the package formster
formster
A PHP Form builder and validation library.
Installation
composer require chtombleson/formster
Usage
Here is a simple example of how to use the class. The handle request function will take any PSR-7 compliant request object.
<?php
use Formster\Form;
$form = new Form();
$form->addField([
'name' => 'username',
'type' => 'text',
'validate' => ['not_empty'],
])
->addField([
'name' => 'password',
'type' => 'password',
'validate' => ['not_empty'],
])
->addField([
'name' => 'login',
'type' => 'submit',
'value' => 'Log In',
]);
if (strtolower($request->getMethod()) == 'post') {
$form->handleRequest($request);
if (!$form->isValid()) {
var_dump($form->getErrors());
} else {
var_dump($form->getData());
}
} else {
echo $form->renderForm();
}
All versions of formster with dependencies
PHP Build Version
Package Version
The package chtombleson/formster contains the following files
Loading the files please wait ....