定制 zofe/dataform 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

zofe/dataform

最新稳定版本:1.0.7

Composer 安装命令:

composer require zofe/dataform

包简介

Form helper / builder with eloquent support, for Deficient

README 文档

README

DataForm is a form builder By default it produce Bootstrap 3 compatible output.

At this moment is built on Deficient (a subset of laravel components including eloquent and blade, plus burp router). The plan is to make it compatible also with laravel, as standard package.

It can

  • Make a Form
  • Bind the form with an eloquent model

usage

as form helper:

    $form = DataForm::create();
    $form->text('title','Title'); //field name, label
    $form->text('body','Body')->rule('required'); //validator 
    $form->submit('Save');
    $form->saved(function() use ($form)
    {
        //do something with post values, then..
        
        $form->message("ok record saved");
        $form->linkRoute("home","Back to the Form");
    });
    ...

form with model binding (preset values and store new values on save):

    $form = DataForm::source(User::find(1));
    $form->text('title','Title'); //field name, label
    $form->textarea('body','Body')->rule('required'); //validation
    $form->checkbox('public','Public');
    $form->select('role', 'Role')->options(Role::lists("name", "id"));
    $form->submit('Save');
    $form->saved(function() use ($form)
    {
        $form->message("ok record saved");
        $form->linkRoute("home","Back to the Form");
    });
    ...

for field "rules" you can reference to laravel validation

note that @ this time:

  • there are only text,textarea,select and checkbox fields
  • model-binding still not support relations

why not starting from laravel?

We choose "deficient" (a subset of laravel components) to be more isoladed, and give the ability to use it stand-alone or embedded in any other project.

Installation

install via composer

{
    "require": {
        "zofe/dataform": "dev-master"
    }
}

Setup

To configure database, views, you must reference to Deficient
This is a small how-to

  • create minimum folders / configuration files
  • deploy dataform views
  • deploy a front controller and a sample (optional, but suggested)
  $ php vendor/zofe/deficient/deficient setup:folders
  $ php vendor/zofe/dataform/dataform setup:views
  $ php vendor/zofe/dataform/dataform setup:router

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固