承接 pleonovich/doform 相关项目开发

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

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

pleonovich/doform

Composer 安装命令:

composer require pleonovich/doform

包简介

Simple way to render html forms.

README 文档

README

Simple way to render html forms

Some examples

text

use DoForm\DoForm as DoForm;

// Description:
DoForm text ( string $name [, string $value = null [, string $extra = null ]] )

// Example:
echo DoForm::factory()->text('name');
// Result:
// <input type='text' id='name' name='name'  value='' >

textarea

use DoForm\DoForm as DoForm;
// Description:
DoForm text ( string $name [, string $value = null [, $cols = 50 [, $rows = 3 [, $extra = null ]]]] )

// Example:
echo DoForm::factory()->textarea('biography');
// Result:
// <textarea id='biography' name='biography' cols='50' rows='3'  ></textarea>

select

use DoForm\DoForm as DoForm;

// Description:
DoForm select ( string $name, array $options [, string $value = null [, string $extra = null ]] )

// Example:
echo DoForm::factory()->select('gender', array('male','famale'));
// Result:
// <select name='gender' id='select_gender' size='1'  >
// <option  value='male'  >male</option>
// <option  value='famale'  >famale</option>
// </select>

selectIndexed

use DoForm\DoForm as DoForm;

// Description:
DoForm selectIndexed ( string $name, array $options [, string $value = null [, string $extra = null ]] )

// Example:
echo DoForm::factory()->selectIndexed('gender1', array('1'=>'famale','2'=>'male'), '2');
// Result:
// <select name='gender1' id='select_gender1' size='1'  >
// <option  value='1'  >famale</option>
// <option  value='2' selected >male</option>
// </select>

selectIndexed

use DoForm\DoForm as DoForm;

// Description:
DoForm selectFormated ( string $name, array $options [, string $value = null [, string $extra = null ]] )

// Example:
echo DoForm::factory()->selectFormated('gender2', array(array('1','famale'),array('2','male')), '2');
// Result:
// <select name='gender2' id='select_gender2' size='1'  >
// <option  value='1'  >famale</option>
// <option  value='2' selected >male</option>
// </select>

checkbox

use DoForm\DoForm as DoForm;

// Description:
DoForm checkbox ( string $name [, string $value = null [, string $extra = null ]] )

// Example:
echo DoForm::factory()->checkbox('maried');
// Result:
// <input type='checkbox' id='maried' name='maried'   />

_file

use DoForm\DoForm as DoForm;

// Description:
DoForm _file ( [ string $name = "file" [, $multiple = true [, $extra = null ]]] )

// Example:
echo DoForm::factory()->_file('avatar');
// Result:
// <input type='file' name='avatar[]' multiple='true' >

submit

use DoForm\DoForm as DoForm;

// Description:
DoForm submit ( string $name [, $extra = null ] )

// Example:
echo DoForm::factory()->submit('Send');
// Result:
// <input type='submit' name='Send'  >

Creating form

use DoForm\DoForm as DoForm;

$form = DoForm::factory()
->text('name')
->textarea('biography')
->select('gender', array('male','famale'))
->selectIndexed('gender1', array('1'=>'famale','2'=>'male'), '2')
->selectFormated('gender2', array(array('1','famale'),array('2','male')), '2')
->checkbox('maried')
->_file('avatar')
->submit('Send');

DoInput

Simple way to render html form inputs

Example:

use DoForm\DoInput as DoInput;

$input = DoInput::text('name');
$input.= DoInput::textarea('biography');
$input.= DoInput::select('gender', array('male','famale'), 'famale');
$input.= DoInput::selectIndexed('gender', array('1'=>'famale','2'=>'male'), '2');
$input.= DoInput::selectFormated('gender', array(array('1','famale'),array('2','male')), '2');
$input.= DoInput::checkbox('maried');
$input.= DoInput::_file('avatar');
$input.= DoInput::submit('Send');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2018-11-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固