pails/form_builder
Composer 安装命令:
composer require pails/form_builder
包简介
README 文档
README
A utility that makes building a form ridiculously easy.
Dependencies
None
Installation
In the root of a pails app, run
pails install form_builder
Configuration
Inside any controller where you want to make use of the form builder,
use the FormBuilder trait.
class DefaultController extends Pails\Controller { use PailsAuthentication; }
Then, in the relevant views, you can call $this->input_for()
string input_for(string data_name, string label, array options)
- data_name - the
nameof the form element - label - the text that should accompany the form element
- options - an array of options, depending on the type of element
- type - (default: text) the type of input
- list -
selectlist, with options - textarea - a large textbox
- radio - a set of radio buttons, with options
- check - a set of checkboxes, with options
- number - a
numberinput type (with options, multiple) - text - a standard text input field
- list -
- value - (default: empty string) the initial value of the element
- tooltip - (default: empty string) the
titleattribute, provides additional information about the input - style - (default: empty string; textarea only) inline CSS styles
- options - (default: array(); radio, check, list, and number only)
an associative array of options. key is the input's
valueand the value is the text that should be displayed for that option
- type - (default: text) the type of input
- Returns: a string of HTML built with the corresponding options
Support
pails-form-builder is a core plugin supported by Synapse Software. Contact us at support@synapsesoftware.com.
统计信息
- 总下载量: 468
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-07-25