pixel418/eloq 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pixel418/eloq

Composer 安装命令:

composer require pixel418/eloq

包简介

Eloq is a cute tool to validate & sanitize a form

关键字:

README 文档

README

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

  1. Let's code
  2. How to Install
  3. How to Contribute
  4. Author & Community

Let's 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 ;)
}
<?php if (!$loginForm->isValid('email')): ?>
	<div class="alert-error"><?= $loginForm->getInputErrorMessage('email') ?></div>
<?php endif; ?>
<input type="text" name="email" value="<?= $loginForm->email ?>" />

<?php if (!$loginForm->isValid('password')): ?>
	<div class="alert-error"><?= $loginForm->getInputErrorMessage('password') ?></div>
<?php endif; ?>
<input type="password" name="password" value="" />

↑ top

How to Install

If you don't have composer, you have to install it.

Add or complete the composer.json file at the root of your project, like this :

{
    "require": {
        "pixel418/eloq": "0.2.*"
    }
}

Eloq can now be downloaded via composer.

Lastly, to use it in your PHP, you can load the composer autoloader :

require_once( './vendor/autoload.php' );

↑ top

How to Contribute

  1. Fork the Eloq repository
  2. Create a new branch for each feature or improvement
  3. Send a pull request from each feature branch to the develop branch

If you don't know much about pull request, you can read the Github article.

All pull requests must follow the PSR2 standard and be accompanied by passing phpunit tests.

↑ top

Author & Community

Eloq is under the MIT License. It is created and maintained by Thomas ZILLIOX.

↑ top

统计信息

  • 总下载量: 429
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-03-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固