Methods summary
public static
|
#
macro( string $name, Closure $macro )
Registers a custom macro.
Registers a custom macro.
Parameters
- $name
string $name
- $macro
Closure
$macro
|
public static
string
|
#
open( string $action = null, string $method = 'POST', array $attributes = array(), boolean $https = null )
Open a HTML form.
echo Form::open();
echo Form::open('user/profile');
echo Form::open('user/profile', 'put');
echo Form::open('user/profile', 'post', array('class' => 'profile'));
Parameters
- $action
string $action
- $method
string $method
- $attributes
array $attributes
- $https
boolean $https
Returns
string
|
protected static
string
|
#
method( string $method )
Determine the appropriate request method to use for a form.
Determine the appropriate request method to use for a form.
Parameters
Returns
string
|
protected static
string
|
#
action( string $action, boolean $https )
Determine the appropriate action parameter to use for a form.
Determine the appropriate action parameter to use for a form.
If no action is specified, the current request URI will be used.
Parameters
- $action
string $action
- $https
boolean $https
Returns
string
|
public static
string
|
#
open_secure( string $action = null, string $method = 'POST', array $attributes = array() )
Open a HTML form with a HTTPS action URI.
Open a HTML form with a HTTPS action URI.
Parameters
- $action
string $action
- $method
string $method
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
open_for_files( string $action = null, string $method = 'POST', array $attributes = array(), boolean $https = null )
Open a HTML form that accepts file uploads.
Open a HTML form that accepts file uploads.
Parameters
- $action
string $action
- $method
string $method
- $attributes
array $attributes
- $https
boolean $https
Returns
string
|
public static
string
|
#
open_secure_for_files( string $action = null, string $method = 'POST', array $attributes = array() )
Open a HTML form that accepts file uploads with a HTTPS action URI.
Open a HTML form that accepts file uploads with a HTTPS action URI.
Parameters
- $action
string $action
- $method
string $method
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
close( )
Close a HTML form.
Returns
string
|
public static
string
|
#
token( )
Generate a hidden field containing the current CSRF token.
Generate a hidden field containing the current CSRF token.
Returns
string
|
public static
string
|
#
label( string $name, string $value, array $attributes = array(), mixed $escape_html = true )
Create a HTML label element.
Create a HTML label element.
echo Form::label('email', 'E-Mail Address');
Parameters
- $name
string $name
- $value
string $value
- $attributes
array $attributes
- $escape_html
Returns
string
|
public static
string
|
#
input( string $type, string $name, mixed $value = null, array $attributes = array() )
Create a HTML input element.
Create a HTML input element.
echo Form::input('text', 'email');
echo Form::input('text', 'email', 'example@gmail.com');
Parameters
- $type
string $type
- $name
string $name
- $value
mixed $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
text( string $name, string $value = null, array $attributes = array() )
Create a HTML text input element.
Create a HTML text input element.
Parameters
- $name
string $name
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
password( string $name, array $attributes = array() )
Create a HTML password input element.
Create a HTML password input element.
Parameters
- $name
string $name
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
hidden( string $name, string $value = null, array $attributes = array() )
Create a HTML hidden input element.
Create a HTML hidden input element.
Parameters
- $name
string $name
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
search( string $name, string $value = null, array $attributes = array() )
Create a HTML search input element.
Create a HTML search input element.
Parameters
- $name
string $name
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
email( string $name, string $value = null, array $attributes = array() )
Create a HTML email input element.
Create a HTML email input element.
Parameters
- $name
string $name
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
telephone( string $name, string $value = null, array $attributes = array() )
Create a HTML telephone input element.
Create a HTML telephone input element.
Parameters
- $name
string $name
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
url( string $name, string $value = null, array $attributes = array() )
Create a HTML URL input element.
Create a HTML URL input element.
Parameters
- $name
string $name
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
number( string $name, string $value = null, array $attributes = array() )
Create a HTML number input element.
Create a HTML number input element.
Parameters
- $name
string $name
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
date( string $name, string $value = null, array $attributes = array() )
Create a HTML date input element.
Create a HTML date input element.
Parameters
- $name
string $name
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
file( string $name, array $attributes = array() )
Create a HTML file input element.
Create a HTML file input element.
Parameters
- $name
string $name
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
textarea( string $name, string $value = '', array $attributes = array() )
Create a HTML textarea element.
Create a HTML textarea element.
Parameters
- $name
string $name
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
select( string $name, array $options = array(), string $selected = null, array $attributes = array() )
Create a HTML select element.
Create a HTML select element.
echo Form::select('sizes', array('S' => 'Small', 'L' => 'Large'));
echo Form::select('sizes', array('S' => 'Small', 'L' => 'Large'), 'L');
Parameters
- $name
string $name
- $options
array $options
- $selected
string $selected
- $attributes
array $attributes
Returns
string
|
protected static
string
|
#
optgroup( array $options, string $label, string $selected )
Create a HTML select element optgroup.
Create a HTML select element optgroup.
Parameters
- $options
array $options
- $label
string $label
- $selected
string $selected
Returns
string
|
protected static
string
|
#
option( string $value, string $display, string $selected )
Create a HTML select element option.
Create a HTML select element option.
Parameters
- $value
string $value
- $display
string $display
- $selected
string $selected
Returns
string
|
public static
string
|
#
checkbox( string $name, string $value = 1, boolean $checked = false, array $attributes = array() )
Create a HTML checkbox input element.
Create a HTML checkbox input element.
echo Form::checkbox('terms', 'yes');
echo Form::checkbox('terms', 'yes', true);
Parameters
- $name
string $name
- $value
string $value
- $checked
boolean $checked
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
radio( string $name, string $value = null, boolean $checked = false, array $attributes = array() )
Create a HTML radio button input element.
Create a HTML radio button input element.
echo Form::radio('drinks', 'Milk');
echo Form::radio('drinks', 'Milk', true);
Parameters
- $name
string $name
- $value
string $value
- $checked
boolean $checked
- $attributes
array $attributes
Returns
string
|
protected static
string
|
#
checkable( string $type, string $name, string $value, boolean $checked, array $attributes )
Create a checkable input element.
Create a checkable input element.
Parameters
- $type
string $type
- $name
string $name
- $value
string $value
- $checked
boolean $checked
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
submit( string $value = null, array $attributes = array() )
Create a HTML submit input element.
Create a HTML submit input element.
Parameters
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
reset( string $value = null, array $attributes = array() )
Create a HTML reset input element.
Create a HTML reset input element.
Parameters
- $value
string $value
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
image( string $url, string $name = null, array $attributes = array() )
Create a HTML image input element.
Create a HTML image input element.
echo Form::image('img/submit.png');
Parameters
- $url
string $url
- $name
string $name
- $attributes
array $attributes
Returns
string
|
public static
string
|
#
button( string $value = null, array $attributes = array() )
Create a HTML button element.
Create a HTML button element.
Parameters
- $value
string $value
- $attributes
array $attributes
Returns
string
|
protected static
mixed
|
#
id( string $name, array $attributes )
Determine the ID attribute for a form element.
Determine the ID attribute for a form element.
Parameters
- $name
string $name
- $attributes
array $attributes
Returns
mixed
|
public static
mixed
|
#
__callStatic( string $method, array $parameters )
Dynamically handle calls to custom macros.
Dynamically handle calls to custom macros.
Parameters
- $method
string $method
- $parameters
array $parameters
Returns
mixed
|