Download the PHP package hashbang/waveform without Composer
On this page you can find all versions of the php package hashbang/waveform. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hashbang/waveform
More information about hashbang/waveform
Files in hashbang/waveform
Package waveform
Short Description PHP input validation make obscenely easy
License MIT
Homepage https://github.com/hash-bang/Waveform
Informations about the package waveform
Waveform - PHP Input validator and generator
Waveform is a form validation and generation class for PHP. It can provide for form (or table or just field) HTML generation as well as validation rules.
Updates
1.4.0
- Switch to Composer packaging system instead of Sparks.
- Removed all CodeIgniter specific stuff
- Added
$waveform->Style()
function to load styles fromstyles/
1.3.0
- Added
$field->Span()
function to display a field without displaying the label (effectively making the input use up two 'columns' instead of label/value layout). This works really well with text boxes (via$row->Text()
) or raw HTML output (via$row->HTML()
) - Added
Value()
function to return the plain text value of a single field (or all fields as an array) instead of using $waveform->Fields flat array access. In the future we could use IO filters which will be required to run when called. - BUGFIX: Chrome no longer gets upset when rendering floating point inputs (via
$row->Float()
)
1.2.0
- New use of Filters to specify which fields should be rendered when generating a form, table or series of inputs
- New
$row->HTML()
alias function to call$row->Label()
$row->HTML()
,$row->Label()
and$row->ReadOnly()
can now take a default value as the first parameter to bypass the need to make another call to$row->Default()
- Creation of
GenHash()
function to generate short unique hashes - Define can now take a null as a name (uses the new
GenHash()
function to make one) GetHash()
method to return all values as a hash (can take a Filter as parameters)- Added
Get()
method as an alias ofField()
1.1.0
- Added Bootstrap form style support
Installation
Installing into CodeIgniter / CakePHP etc.
Download this GIT repository and copy into your application directory.
Alternatively, install with Composer.
Using Waveform in PHP
While Waveform is primarily MVC + Composer based it can also be used as a stand-alone.
Grab the main waveform.php file from the libraries directory and simply dump it wherever it is needed.
See the examples below for some tips on how to use it.
Examples
Simple signup page
The below shows a simple user sign up page controller written for CodeIgniter.
// FIXME: Do something now they've signed up
} else { // New page OR Something failed
echo $this->Waveform->Form(); // Output the Waveform <form> - usually this would itself be inside a view.
}
}
}
?>
Editing a database record
The below shows a simple car editing controller
Stand-alone PHP usage
Waveform can also be used as a stand-alone library. To do this simply extract the waveform.php
file from the lib/
directory and use it in your application like you would a normal PHP file.
The below example loads up Waveform, defines some fields then sits out a form for the user to enter data into.
Finally the form is validated and (should everything be ok) the values passed on for further processing.