gsouf/uform 问题修复 & 功能扩展

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

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

gsouf/uform

最新稳定版本:0.2.0

Composer 安装命令:

composer require gsouf/uform

包简介

Full featured form library

README 文档

README

Latest Stable Version Build Status Test Coverage

UForm is a form validation/filtering/rendering library for PHP.

Usage

Quick start

use UForm\Builder;

$form = 
     Builder::init("action", "POST")
         ->columnGroup()
             ->column(3, 12)
                 ->text("firstname", "Firstname")->required()->stringLength(2, 20)
                 ->text("lastname", "Lastname")->required()->stringLength(2, 20)
             ->close()
             ->column(3, 12)
                 ->panel('Login Information')
                     ->text("login", "Login")->required()->stringLength(2, 20)
                     ->password("password", "Password")->required()->stringLength(2, 20)
                 ->close()
             ->close()
         ->close()
     ->getForm();



//If it's a post request we validate the form with the post data
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    $formContext = $form->validate($form->getInputFromGlobals());
    if ($formContext->isValid()) {
        $filteredData = $formContext->getData();
        // Do some logic with data
        // ...
    }
} else { // Or else we just generate a context with empty values
    $formContext = $form->generateContext([]);
}

// We want to render some html for bootstrap 3
$formRenderer = new Bootstrap3Render();
$html = $formRenderer->render($formContext);

echo $html;

The above example will result in:

Full documentation

The full documentation will available at gsouf.github.io/UForm once the project will be considered as stable

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固