FormBuilder
class FormBuilder (View source)
Traits
Methods
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Open up a new HTML form.
Create a new model based form builder.
Set the model instance on the form builder.
Close the current form.
Generate a hidden field with the current CSRF token.
Create a form label element.
Create a form input field.
Create a text input field.
Create a password input field.
Create a hidden input field.
Create an e-mail input field.
Create a url input field.
Create a file input field.
Create a textarea input field.
Create a number input field.
Create a select box field.
Create a select range field.
Create a select year field.
Create a select month field.
Get the select option for the given value.
Create a checkbox input field.
Create a radio button input field.
Create a HTML reset input element.
Create a HTML image input element.
Create a submit button element.
Create a button element.
Get the ID attribute for a field name.
Get the value that should be assigned to the field.
Get a value from the session's old input.
Determine if the old input is empty.
Get the session store implementation.
Details
in MacroableTrait at line line 19
static
void
macro(
string $name,
callable $macro)
Register a custom macro.
in MacroableTrait at line line 30
static
boolean
hasMacro(
string $name)
Checks if macro is registered
in MacroableTrait at line line 44
static
mixed
__callStatic(
string $method,
array $parameters)
Dynamically handle calls to the class.
in MacroableTrait at line line 63
mixed
__call(
string $method,
array $parameters)
Dynamically handle calls to the class.
at line line 82
void
__construct(
HtmlBuilder $html,
UrlGenerator $url, $csrfToken)
Create a new form builder instance.
at line line 142
string
model(
mixed $model,
array $options = array())
Create a new model based form builder.
at line line 192
string
label(
string $name,
string $value = null,
array $options = array())
Create a form label element.
at line line 224
string
input(
string $type,
string $name,
string $value = null,
array $options = array())
Create a form input field.
at line line 256
string
text(
string $name,
string $value = null,
array $options = array())
Create a text input field.
at line line 268
string
password(
string $name,
array $options = array())
Create a password input field.
at line line 281
string
hidden(
string $name,
string $value = null,
array $options = array())
Create a hidden input field.
at line line 294
string
email(
string $name,
string $value = null,
array $options = array())
Create an e-mail input field.
at line line 307
string
url(
string $name,
string $value = null,
array $options = array())
Create a url input field.
at line line 332
string
textarea(
string $name,
string $value = null,
array $options = array())
Create a textarea input field.
at line line 399
string
number(
string $name,
string|null $value = null,
array $options = array())
Create a number input field.
at line line 413
string
select(
string $name,
array $list = array(),
string $selected = null,
array $options = array())
Create a select box field.
at line line 454
string
selectRange(
string $name,
string $begin,
string $end,
string $selected = null,
array $options = array())
Create a select range field.
at line line 485
string
selectMonth(
string $name,
string $selected = null,
array $options = array(),
string $format = '%B')
Create a select month field.
at line line 505
string
getSelectOption(
string $display,
string $value,
string $selected)
Get the select option for the given value.
at line line 578
string
checkbox(
string $name,
mixed $value = 1,
bool $checked = null,
array $options = array())
Create a checkbox input field.
at line line 592
string
radio(
string $name,
mixed $value = null,
bool $checked = null,
array $options = array())
Create a radio button input field.
at line line 694
string
reset(
string $value,
array $attributes = array())
Create a HTML reset input element.
at line line 707
string
image(
string $url,
string $name = null,
array $attributes = array())
Create a HTML image input element.
at line line 721
string
submit(
string $value = null,
array $options = array())
Create a submit button element.
at line line 733
string
button(
string $value = null,
array $options = array())
Create a button element.
at line line 872
string
getIdAttribute(
string $name,
array $attributes)
Get the ID attribute for a field name.
at line line 892
string
getValueAttribute(
string $name,
string $value = null)
Get the value that should be assigned to the field.