PHPackages                             hashbang/waveform - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. hashbang/waveform

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

hashbang/waveform
=================

PHP input validation make obscenely easy

v1.4.0(12y ago)032MITPHPPHP &gt;=5.0.0

Since Mar 14Pushed 12y ago1 watchersCompare

[ Source](https://github.com/hash-bang/Waveform)[ Packagist](https://packagist.org/packages/hashbang/waveform)[ Docs](https://github.com/hash-bang/Waveform)[ RSS](/packages/hashbang-waveform/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Waveform - PHP Input validator and generator
============================================

[](#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
=======

[](#updates)

1.4.0
-----

[](#140)

- Switch to [Composer](http://getcomposer.org) packaging system instead of Sparks.
- Removed all CodeIgniter specific stuff
- Added `$waveform->Style()` function to load styles from `styles/`

1.3.0
-----

[](#130)

- 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-&gt;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
-----

[](#120)

- 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 of `Field()`

1.1.0
-----

[](#110)

- Added Bootstrap form style support

Installation
============

[](#installation)

Installing into CodeIgniter / CakePHP etc.
------------------------------------------

[](#installing-into-codeigniter--cakephp-etc)

Download this GIT repository and copy into your application directory.

Alternatively, install with [Composer](http://getcomposer.org).

Using Waveform in PHP
---------------------

[](#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
========

[](#examples)

Simple signup page
------------------

[](#simple-signup-page)

The below shows a simple user sign up page controller written for [CodeIgniter](http://codeigniter.com/).

```

			// FIXME: Do something now they've signed up
		} else { // New page OR Something failed
			echo $this->Waveform->Form(); // Output the Waveform  - usually this would itself be inside a view.
		}
	}
}
?>

```

Editing a database record
-------------------------

[](#editing-a-database-record)

The below shows a simple car editing controller

```
