承接 fyre/formbuilder 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

fyre/formbuilder

Composer 安装命令:

composer require fyre/formbuilder

包简介

A form builder library.

README 文档

README

FyreFormBuilder is a free, open-source form builder library for PHP.

Table Of Contents

Installation

Using Composer

composer require fyre/formbuilder

In PHP:

use Fyre\Form\FormBuilder;

Basic Usage

$form = new FormBuilder($html);

Methods

Button

Render a button element.

  • $content is a string representing the button content.
  • $options is an array of options for rendering the button.
$button = $form->button($content, $options);

By default, the button content will be HTML escaped. To disable this, set the escape value to false in the options array.

All other options will be created as attributes on the button element.

Close

Render a form close tag.

$close = $form->close();

Fieldset Close

Render a fieldset close tag.

$fieldsetClose = $form->fieldsetClose();

Fieldset Open

Render a fieldset open tag.

  • $options is an array of options for rendering the fieldset.
$fieldset = $form->fieldsetOpen($options);

All options will be created as attributes on the fieldset element.

Input

Render an input element.

  • $name is a string representing the input name.
  • $options is an array of options for rendering the input.
$input = $form->input($name, $options);

All options will be created as attributes on the input element.

By default, the input will be created as a text type. You can use the following helper methods to generate other input type fields.

$input = $form->checkbox($name, $options);
$input = $form->color($name, $options);
$input = $form->date($name, $options);
$input = $form->datetime($name, $options);
$input = $form->email($name, $options);
$input = $form->file($name, $options);
$input = $form->hidden($name, $options);
$input = $form->image($name, $options);
$input = $form->month($name, $options);
$input = $form->number($name, $options);
$input = $form->password($name, $options);
$input = $form->radio($name, $options);
$input = $form->range($name, $options);
$input = $form->reset($name, $options);
$input = $form->search($name, $options);
$input = $form->submit($name, $options);
$input = $form->tel($name, $options);
$input = $form->text($name, $options);
$input = $form->time($name, $options);
$input = $form->url($name, $options);
$input = $form->week($name, $options);

Label

Render a label element.

  • $content is a string representing the label content.
  • $options is an array of options for rendering the label.
$label = $form->label($content, $options);

By default, the label content will be HTML escaped. To disable this, set the escape value to false in the options array.

All other options will be created as attributes on the label element.

Legend

Render a legend element.

  • $content is a string representing the legend content.
  • $options is an array of options for rendering the legend.
$legend = $form->legend($content, $options);

By default, the legend content will be HTML escaped. To disable this, set the escape value to false in the options array.

All other options will be created as attributes on the legend element.

Open

Render a form open tag.

  • $action is a string representing the form action.
  • $options is an array of options for rendering the form.
$open = $form->open($action, $options);

All options will be created as attributes on the form element.

Open Multipart

Render a multipart form open tag.

  • $action is a string representing the form action.
  • $options is an array of options for rendering the form.
$open = $form->openMultipart($action, $options);

All options will be created as attributes on the form element.

Select

Render a select element.

  • $name is a string representing the select name.
  • $options is an array of options for rendering the select.
$select = $form->select($name, $options);

Option elements can be created by specifying an options value in the options array. Selected options can be specified using the selected value in the options array.

All other options will be created as attributes on the select element.

Select Multiple

Render a multiple select element.

  • $name is a string representing the select name.
  • $options is an array of options for rendering the select.
$select = $form->selectMulti($name, $options);

Option elements can be created by specifying an options value in the options array. Selected options can be specified using the selected value in the options array.

All other options will be created as attributes on the select element.

Textarea

Render a textarea element.

  • $name is a string representing the textarea name.
  • $options is an array of options for rendering the textarea.
$textarea = $form->textarea($name, $options);

All options will be created as attributes on the textarea element.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固