PHPackages                             pixel418/eloq - 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. pixel418/eloq

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

pixel418/eloq
=============

Eloq is a cute tool to validate &amp; sanitize a form

v0.2.2(11y ago)14291MITPHPPHP &gt;=5.4.0

Since Mar 24Pushed 11y agoCompare

[ Source](https://github.com/Elephant418/Eloq)[ Packagist](https://packagist.org/packages/pixel418/eloq)[ Docs](https://github.com/Pixel418/Eloq)[ RSS](/packages/pixel418-eloq/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (8)Used By (1)

Eloq [![Build Status](https://camo.githubusercontent.com/51cb50075fabf4661af46664a804045c3b8a7a5d547ccef1369a764b02a1a0e3/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f506978656c3431382f456c6f712e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/Pixel418/Eloq?branch=master)
======================================================================================================================================================================================================================================================================================================

[](#eloq-)

Eloq is a PHP library to improve the security &amp; the data validation of user forms.
It also improves code readability by separating the forms definition and treatment.

1. [Let's code](#lets-code)
2. [How to Install](#how-to-install)
3. [How to Contribute](#how-to-contribute)
4. [Author &amp; Community](#author--community)

Let's code
----------

[](#lets-code)

```
// Login form definition
$loginForm = (new Form)
    ->addInput('email', 'required|email|validate_email')
    ->addInput('password', 'required');

// Treatment
if ($loginForm->isValid()) {
    $email = $loginForm->email;
    $password = $loginForm->password;
    // Here we should log the user ;)
}
```

```
isValid('email')): ?>
	getInputErrorMessage('email') ?>
