abstract class FormBaseWidget extends FormWidget

Traits

PoppyTrait

Properties

bool $inbox from  FormWidget
$ajax
protected string $title

The title of form.

from  FormWidget
protected bool $withContent

是否包含 JS 加载界面

from  FormWidget
protected Field[] $fields from  FormWidget
protected array $data from  FormWidget
protected array $attributes from  FormWidget
protected array $buttons

Available buttons.

from  FormWidget
protected Closure|null $boxTools 可用操作 from  FormWidget
protected array $width

Width for label and submit field.

from  FormWidget

Methods

AuthManager
pyAuth()

get auth

pyTranslator()

get translator

Repository
pyConfig()

Get configuration instance.

DatabaseManager
pyDb()

get db

Kernel
pyConsole()

Get console instance.

Container
pyContainer()

Get IoC Container.

Mailer
pyMailer()

Get mailer instance.

SessionManager|Store
pySession()

Get session instance.

Request
pyRequest()

get request

Redirector
pyRedirector()

get redirector

Factory
pyValidation()

get validation

Dispatcher
pyEvent()

get event

LoggerInterface
pyLogger()

get logger

ResponseFactory
pyResponse()

get response

Filesystem
pyFile()

get file

UrlGenerator
pyUrl()

get url

mixed
pyCache(string $tag = '')

get cache

RedisManager
pyRedis()

get redis

Factory
pyView()

get view

pyPoppy()

get poppy

Ini
pyIni()

Ini Parser

Xml
pyXml()

Ini Parser

pyYaml()

Yaml Parser

__construct(array $data = [])

Form constructor.

array
data()

The data of the form.

fill(array|Arrayable $data = [])

Fill data to form fields.

$this
sanitize()

No description

attribute(string|array $attr, string $value = '')

Add form attributes.

string
formatAttribute(array $attributes = [])

Format form attributes form array to html.

$this
action(string $action)

Action uri of the form.

method(string $method = 'POST')

Method of the form.

$this
disablePjax()

Disable Pjax.

$this
disableReset()

Disable reset button.

$this
disableSubmit()

Disable submit button.

$this
setWidth(int $fieldWidth = 8, int $labelWidth = 2)

Set field and label width in current form.

pushField(Field $field)

Add a form field to form.

array
fields()

Get all fields of form.

bool
hasFile()

Determine if form fields has files.

bool|MessageBag
validate(Request $request)

Validate this form fields.

unbox()

No description

boxTools(Closure $closure)

设定工具栏

render()

Render the form.

Field|$this
__call(string $method, array $arguments)

Generate a Field object and add to form builder if Field exists.

string
title()

Get form title.

void
initFormAttributes()

Initialize the form attributes.

array
getVariables()

Get variables for render form.

MessageBag
mergeValidationMessages(Validator[] $validators)

Merge validation messages from input validators.

code(mixed $name, mixed $label)

No description

text(mixed $name, mixed $label)

No description

link(mixed $label)

No description

password(mixed $name, mixed $label)

No description

checkbox(mixed $name, mixed $label)

No description

radio(mixed $name, mixed $label)

No description

select(mixed $name, mixed $label)

No description

selectDo(mixed $name, mixed $label)

No description

multipleSelect(mixed $name, mixed $label)

No description

textarea(mixed $name, mixed $label)

No description

hidden(mixed $name, mixed $label)

No description

Id
id(mixed $name, mixed $label)

No description

Ip
ip(mixed $name, mixed $label)

No description

Url
url(mixed $name, mixed $label)

No description

color(mixed $name, mixed $label)

No description

captcha(mixed $name, mixed $label)

No description

email(mixed $name, mixed $label)

No description

mobile(mixed $name, mixed $label)

No description

file(mixed $name, mixed $label)

No description

image(mixed $name, mixed $label)

No description

multiImage(mixed $name, mixed $label)

No description

date(mixed $name, mixed $label)

No description

datetime(mixed $name, mixed $label)

No description

time(mixed $name, mixed $label)

No description

year(mixed $column, mixed $label)

No description

month(mixed $column, mixed $label)

No description

dateRange(mixed $start, mixed $end, mixed $label)

No description

DateTimeRange
dateTimeRange(mixed $at, mixed $label)

No description

timeRange(mixed $start, mixed $end, mixed $label)

No description

number(mixed $name, mixed $label)

No description

currency(mixed $name, mixed $label)

No description

switch() $$name, $label)

No description

display(mixed $name, mixed $label)

No description

divider(mixed $title)

No description

editor(mixed $name, mixed $label)

No description

decimal(mixed $column, mixed $label)

No description

html(mixed $html, mixed $arguments)

No description

tags(mixed $column, mixed $label)

No description

timezone(mixed $column, mixed $label)

No description

keyword(mixed $column, mixed $label)

No description

question(mixed $column, mixed $label)

No description

hook(mixed $column, mixed $label)

No description

tableInput(mixed $column, mixed $label)

No description

mixed
handle(Request $request)

Handle the form request.

Details

in PoppyTrait at line 43
protected AuthManager pyAuth()

get auth

Return Value

AuthManager

in PoppyTrait at line 52
protected Translator pyTranslator()

get translator

Return Value

Translator

in PoppyTrait at line 62
protected Repository pyConfig()

Get configuration instance.

Return Value

Repository

in PoppyTrait at line 72
protected DatabaseManager pyDb()

get db

Return Value

DatabaseManager

in PoppyTrait at line 81
protected Kernel pyConsole()

Get console instance.

Return Value

Kernel

in PoppyTrait at line 90
protected Container pyContainer()

Get IoC Container.

Return Value

Container

| Application

in PoppyTrait at line 99
protected Mailer pyMailer()

Get mailer instance.

Return Value

Mailer

in PoppyTrait at line 108
protected SessionManager|Store pySession()

Get session instance.

Return Value

SessionManager|Store

in PoppyTrait at line 117
protected Request pyRequest()

get request

Return Value

Request

in PoppyTrait at line 127
protected Redirector pyRedirector()

get redirector

Return Value

Redirector

in PoppyTrait at line 136
protected Factory pyValidation()

get validation

Return Value

Factory

in PoppyTrait at line 146
protected Dispatcher pyEvent()

get event

Return Value

Dispatcher

in PoppyTrait at line 156
protected LoggerInterface pyLogger()

get logger

Return Value

LoggerInterface

in PoppyTrait at line 166
protected ResponseFactory pyResponse()

get response

Return Value

ResponseFactory

in PoppyTrait at line 176
protected Filesystem pyFile()

get file

Return Value

Filesystem

in PoppyTrait at line 186
protected UrlGenerator pyUrl()

get url

Return Value

UrlGenerator

in PoppyTrait at line 197
protected mixed pyCache(string $tag = '')

get cache

Parameters

string $tag tag

Return Value

mixed

in PoppyTrait at line 211
protected RedisManager pyRedis()

get redis

Return Value

RedisManager

in PoppyTrait at line 220
protected Factory pyView()

get view

Return Value

Factory

in PoppyTrait at line 229
protected Poppy pyPoppy()

get poppy

Return Value

Poppy

in PoppyTrait at line 238
protected Ini pyIni()

Ini Parser

Return Value

Ini

in PoppyTrait at line 247
protected Xml pyXml()

Ini Parser

Return Value

Xml

in PoppyTrait at line 256
protected Yaml pyYaml()

Yaml Parser

Return Value

Yaml

in FormWidget at line 144
__construct(array $data = [])

Form constructor.

Parameters

array $data

at line 45
array data()

The data of the form.

Return Value

array

in FormWidget at line 166
FormWidget fill(array|Arrayable $data = [])

Fill data to form fields.

Parameters

array|Arrayable $data

Return Value

FormWidget

in FormWidget at line 182
$this sanitize()

No description

Return Value

$this

in FormWidget at line 199
FormWidget attribute(string|array $attr, string $value = '')

Add form attributes.

Parameters

string|array $attr
string $value

Return Value

FormWidget

in FormWidget at line 220
string formatAttribute(array $attributes = [])

Format form attributes form array to html.

Parameters

array $attributes

Return Value

string

in FormWidget at line 243
$this action(string $action)

Action uri of the form.

Parameters

string $action

Return Value

$this

in FormWidget at line 253
FormWidget method(string $method = 'POST')

Method of the form.

Parameters

string $method

Return Value

FormWidget

in FormWidget at line 269
$this disablePjax()

Disable Pjax.

Return Value

$this

in FormWidget at line 281
$this disableReset()

Disable reset button.

Return Value

$this

in FormWidget at line 293
$this disableSubmit()

Disable submit button.

Return Value

$this

in FormWidget at line 308
$this setWidth(int $fieldWidth = 8, int $labelWidth = 2)

Set field and label width in current form.

Parameters

int $fieldWidth
int $labelWidth

Return Value

$this

in FormWidget at line 331
FormWidget pushField(Field $field)

Add a form field to form.

Parameters

Field $field

Return Value

FormWidget

in FormWidget at line 342
array fields()

Get all fields of form.

Return Value

array

in FormWidget at line 352
bool hasFile()

Determine if form fields has files.

Return Value

bool

in FormWidget at line 370
bool|MessageBag validate(Request $request)

Validate this form fields.

Parameters

Request $request

Return Value

bool|MessageBag

in FormWidget at line 389
unbox()

No description

in FormWidget at line 402
FormWidget boxTools(Closure $closure)

设定工具栏

Parameters

Closure $closure

Return Value

FormWidget

in FormWidget at line 411
render()

Render the form.

in FormWidget at line 462
Field|$this __call(string $method, array $arguments)

Generate a Field object and add to form builder if Field exists.

Parameters

string $method
array $arguments

Return Value

Field|$this

in FormWidget at line 483
string title()

Get form title.

Return Value

string

in FormWidget at line 491
protected void initFormAttributes()

Initialize the form attributes.

Return Value

void

in FormWidget at line 508
protected array getVariables()

Get variables for render form.

Return Value

array

in FormWidget at line 532
protected MessageBag mergeValidationMessages(Validator[] $validators)

Merge validation messages from input validators.

Parameters

Validator[] $validators

Return Value

MessageBag

in FormWidget at line 73
Code code(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Code

in FormWidget at line 73
Text text(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Text

No description

Parameters

mixed $label

Return Value

Link

in FormWidget at line 73
Password password(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Password

in FormWidget at line 73
Checkbox checkbox(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Checkbox

in FormWidget at line 73
Radio radio(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Radio

in FormWidget at line 73
Select select(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Select

in FormWidget at line 73
SelectDo selectDo(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

SelectDo

in FormWidget at line 73
MultipleSelect multipleSelect(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

MultipleSelect

in FormWidget at line 73
Textarea textarea(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Textarea

in FormWidget at line 73
Hidden hidden(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Hidden

in FormWidget at line 73
Id id(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Id

in FormWidget at line 73
Ip ip(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Ip

in FormWidget at line 73
Url url(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Url

in FormWidget at line 73
Color color(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Color

in FormWidget at line 73
Captcha captcha(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Captcha

in FormWidget at line 73
Email email(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Email

in FormWidget at line 73
Mobile mobile(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Mobile

in FormWidget at line 73
File file(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

File

in FormWidget at line 73
Image image(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Image

in FormWidget at line 73
MultiImage multiImage(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

MultiImage

in FormWidget at line 73
Date date(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Date

in FormWidget at line 73
Datetime datetime(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Datetime

in FormWidget at line 73
Time time(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Time

in FormWidget at line 73
Year year(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Year

in FormWidget at line 73
Month month(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Month

in FormWidget at line 73
DateRange dateRange(mixed $start, mixed $end, mixed $label)

No description

Parameters

mixed $start
mixed $end
mixed $label

Return Value

DateRange

in FormWidget at line 73
DateTimeRange dateTimeRange(mixed $at, mixed $label)

No description

Parameters

mixed $at
mixed $label

Return Value

DateTimeRange

in FormWidget at line 73
TimeRange timeRange(mixed $start, mixed $end, mixed $label)

No description

Parameters

mixed $start
mixed $end
mixed $label

Return Value

TimeRange

in FormWidget at line 73
Number number(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Number

in FormWidget at line 73
Currency currency(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Currency

in FormWidget at line 73
SwitchField switch() $$name, $label)

No description

Parameters

) $$name
$label

Return Value

SwitchField

in FormWidget at line 73
Display display(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Display

in FormWidget at line 73
Divider divider(mixed $title)

No description

Parameters

mixed $title

Return Value

Divider

in FormWidget at line 73
Editor editor(mixed $name, mixed $label)

No description

Parameters

mixed $name
mixed $label

Return Value

Editor

in FormWidget at line 73
Decimal decimal(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Decimal

in FormWidget at line 73
Html html(mixed $html, mixed $arguments)

No description

Parameters

mixed $html
mixed $arguments

Return Value

Html

in FormWidget at line 73
Tags tags(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Tags

in FormWidget at line 73
Timezone timezone(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Timezone

in FormWidget at line 73
Keyword keyword(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Keyword

in FormWidget at line 73
Question question(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Question

in FormWidget at line 73
Hook hook(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

Hook

in FormWidget at line 73
TableInput tableInput(mixed $column, mixed $label)

No description

Parameters

mixed $column
mixed $label

Return Value

TableInput

at line 25
mixed handle(Request $request)

Handle the form request.

Parameters

Request $request

Return Value

mixed