Use PHP to quickly create a modern form form, support the front-end JS extension, is convenient

Source: Internet
Author: User

Form-builder

Use PHP to quickly create a modern form form, including check boxes, radio boxes, input boxes, drop-down selection boxes and other elements, as well as the provincial city level three linkage, time selection, date selection, color selection, file/image upload and other functions.

View more : GitHub address | Composer Address

Forms using the Form-create JS form Builder If it helps you, you can support it at the top right corner of the GitHub point, "Star"! This project is also in the continuous development and improvement, if there are suggestions or questions, please put the installation here
Composer require Xaboy/form-builder

Example

Individual component Configuration Properties click to view

Please configure the formsuccessscript property in config/config.php . Set to the form after the successful JS code or JS address, re- window.formCreate.formSuccess method (with <script> label) or directly modify formscript.php

namespace Test; UseFormbuilder\form;//Input Component$input= Form::input (' goods_name ', ' Product name '));//Date Range Selection Component$dateRange= Form::DateRange (' Limit_time ', ' Interval date ',Strtotime('-ten day '), Time());//Two-level linkage components of provinces and cities$cityArea= form::city (' address ', ' Goods receipt ',[    ' Shaanxi Province ', ' Xian city ']);$checkbox= Form::checkbox (' label ', ' form ', [])options ([[' Value ' = ' 1 ', ' label ' = ' good ', ' disabled ' =true],    [' Value ' = ' 2 ', ' label ' = ' convenient ', ' disabled ' =true]]);//Create a form$form= Form::create ('/save.php ',[    $input,$dateRange,$cityArea]);$html=$form->setmethod (' Get ')->settitle (' Edit product ')view ();//Output Form pageEcho $html;

Component
Namespace \formbuilder\form

  • Form::cascader Three-level linkage, value is an array type
  • form::city Provincial level two linkage, value is the array type
  • Form::cityarea Provincial Three-level linkage, value is the array type
  • form::checkbox check box
  • Form::color Color selection
  • Form::d ate Date selection
  • Form::d aterange Date range selection, value is array type
  • Form::d atetime date + Time selection
  • Form::d atetimerange date + time interval selection, value is array type
  • form::year Year selection
  • form::month Month selection
  • Form::frame Frame Components
  • form::frameinputs Frame component, input type, value is array type
  • Form::framefiles Frame component, file type, value is array type
  • form::frameimages Frame component, image type, value is array type
  • Form::frameinputone Frame component, input type, value String|number type
  • Form::framefileone Frame component, file type, value String|number type
  • Form::frameimageone Frame component, image type, value string|number type
  • Form::hidden Hidden components
  • form::number Digital input Box
  • form::input input box, other type:text type form::text , password type Form::p assword , textarea type Form::textarea , url type form::url , email type form::email , date type Form::idate
  • form::radio Radio Box
  • Form::rate Scoring components
  • form::select Select selection box
  • form::selectmultiple Select box, multiple selection, value is array type
  • form::selectone Select selection box, radio
  • form::slider Slider Assembly
  • form::sliderrange Slider assembly, Interval selection,
  • form::switches Switch Assembly
  • Form::timepicker
  • form::time Time Selection component
  • form::timerange time interval Select component, value is array type
  • form::upload Uploading components
  • form::uploadimages Multi-image upload component, value is an array type
  • form::uploadfiles Multi-File Upload component, value is an array type
  • Form::uploadimageone Single-image upload component
  • form::uploadfileone Single File Upload component
Output
Namespace \formbuilder\json

    • json::succ (msg,data = []) form submitted successfully
    • form::fail (errormsg,data = []) form submission failed
    • form::uploadsucc (filepath,msg) file/image upload successful, upload successful return file address
    • Form::uploadfail (errormsg) file/Picture upload failed

Use PHP to quickly create a modern form form, support the front-end JS extension, is convenient

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.