PHP Class LaravelBook\Laravel4Powerpack\Form

Show file Open project: laravelbook/laravel4-powerpack

Public Properties

Property Type Description
$labels array All of the label names that have been created.
$macros array The registered custom macros.
$spoofer string The request spoofer.

Protected Properties

Property Type Description
$encoding string The encoding to use.
$html HTML The HTML helper
$url Illuminate\Routing\UrlGenerator The url generator instance

Public Methods

Method Description
__call ( string $method, array $parameters ) : mixed Dynamically handle calls to custom macros.
__construct ( HTML $html )
button ( string $value = null, array $attributes = [] ) : string Create a HTML button element.
checkbox ( string $name, string $value = 1, boolean $checked = false, array $attributes = [] ) : string Create a HTML checkbox input element.
close ( ) : string Close a HTML form.
date ( string $name, string $value = null, array $attributes = [] ) : string Create a HTML date input element.
email ( string $name, string $value = null, array $attributes = [] ) : string Create a HTML email input element.
file ( string $name, array $attributes = [] ) : string Create a HTML file input element.
hidden ( string $name, string $value = null, array $attributes = [] ) : string Create a HTML hidden input element.
image ( string $url, string $name = null, array $attributes = [] ) : string Create a HTML image input element.
input ( string $type, string $name, mixed $value = null, array $attributes = [] ) : string Create a HTML input element.
label ( string $name, string $value, array $attributes = [] ) : string Create a HTML label element.
macro ( string $name, Closure $macro ) : void Registers a custom macro.
number ( string $name, string $value = null, array $attributes = [] ) : string Create a HTML number input element.
open ( string $action = null, string $method = 'POST', array $attributes = [], boolean $https = null ) : string Open a HTML form.
openForFiles ( string $action = null, string $method = 'POST', array $attributes = [], boolean $https = null ) : string Open a HTML form that accepts file uploads.
openSecure ( string $action = null, string $method = 'POST', array $attributes = [] ) : string Open a HTML form with a HTTPS action URI.
openSecureForFiles ( string $action = null, string $method = 'POST', array $attributes = [] ) : string Open a HTML form that accepts file uploads with a HTTPS action URI.
password ( string $name, array $attributes = [] ) : string Create a HTML password input element.
radio ( string $name, string $value = null, boolean $checked = false, array $attributes = [] ) : string Create a HTML radio button input element.
reset ( string $value = null, array $attributes = [] ) : string Create a HTML reset input element.
search ( string $name, string $value = null, array $attributes = [] ) : string Create a HTML search input element.
select ( string $name, array $options = [], string $selected = null, array $attributes = [] ) : string Create a HTML select element.
submit ( string $value = null, array $attributes = [] ) : string Create a HTML submit input element.
telephone ( string $name, string $value = null, array $attributes = [] ) : string Create a HTML telephone input element.
text ( string $name, string $value = null, array $attributes = [] ) : string Create a HTML text input element.
textarea ( string $name, string $value = '', array $attributes = [] ) : string Create a HTML textarea element.
token ( ) : string Generate a hidden field containing the current CSRF token.
url ( string $name, string $value = null, array $attributes = [] ) : string Create a HTML URL input element.

Protected Methods

Method Description
action ( string $action, boolean $https ) : string Determine the appropriate action parameter to use for a form.
checkable ( string $type, string $name, string $value, boolean $checked, array $attributes ) : string Create a checkable input element.
id ( string $name, array $attributes ) : mixed Determine the ID attribute for a form element.
method ( string $method ) : string Determine the appropriate request method to use for a form.
optgroup ( array $options, string $label, string $selected ) : string Create a HTML select element optgroup.
option ( string $value, string $display, string $selected ) : string Create a HTML select element option.

Method Details

__call() public method

Dynamically handle calls to custom macros.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
return mixed

__construct() public method

public __construct ( HTML $html )
$html HTML

action() protected method

If no action is specified, the current request URI will be used.
protected action ( string $action, boolean $https ) : string
$action string
$https boolean
return string

button() public method

Create a HTML button element.
public button ( string $value = null, array $attributes = [] ) : string
$value string
$attributes array
return string

checkable() protected method

Create a checkable input element.
protected checkable ( string $type, string $name, string $value, boolean $checked, array $attributes ) : string
$type string
$name string
$value string
$checked boolean
$attributes array
return string

checkbox() public method

Create a HTML checkbox input element.
public checkbox ( string $name, string $value = 1, boolean $checked = false, array $attributes = [] ) : string
$name string
$value string
$checked boolean
$attributes array
return string

close() public method

Close a HTML form.
public close ( ) : string
return string

date() public method

Create a HTML date input element.
public date ( string $name, string $value = null, array $attributes = [] ) : string
$name string
$value string
$attributes array
return string

email() public method

Create a HTML email input element.
public email ( string $name, string $value = null, array $attributes = [] ) : string
$name string
$value string
$attributes array
return string

file() public method

Create a HTML file input element.
public file ( string $name, array $attributes = [] ) : string
$name string
$attributes array
return string

hidden() public method

Create a HTML hidden input element.
public hidden ( string $name, string $value = null, array $attributes = [] ) : string
$name string
$value string
$attributes array
return string

id() protected method

Determine the ID attribute for a form element.
protected id ( string $name, array $attributes ) : mixed
$name string
$attributes array
return mixed

image() public method

Create a HTML image input element.
public image ( string $url, string $name = null, array $attributes = [] ) : string
$url string
$name string
$attributes array
return string

input() public method

Create a HTML input element.
public input ( string $type, string $name, mixed $value = null, array $attributes = [] ) : string
$type string
$name string
$value mixed
$attributes array
return string

label() public method

Create a HTML label element.
public label ( string $name, string $value, array $attributes = [] ) : string
$name string
$value string
$attributes array
return string

macro() public method

Registers a custom macro.
public macro ( string $name, Closure $macro ) : void
$name string
$macro Closure
return void

method() protected method

Determine the appropriate request method to use for a form.
protected method ( string $method ) : string
$method string
return string

number() public method

Create a HTML number input element.
public number ( string $name, string $value = null, array $attributes = [] ) : string
$name string
$value string
$attributes array
return string

open() public method

Open a "POST" form to the current request URI echo Form::open(); Open a "POST" form to a given URI echo Form::open('user/profile'); Open a "PUT" form to a given URI echo Form::open('user/profile', 'put'); Open a form that has HTML attributes echo Form::open('user/profile', 'post', array('class' => 'profile'));
public open ( string $action = null, string $method = 'POST', array $attributes = [], boolean $https = null ) : string
$action string
$method string
$attributes array
$https boolean
return string

openForFiles() public method

Open a HTML form that accepts file uploads.
public openForFiles ( string $action = null, string $method = 'POST', array $attributes = [], boolean $https = null ) : string
$action string
$method string
$attributes array
$https boolean
return string

openSecure() public method

Open a HTML form with a HTTPS action URI.
public openSecure ( string $action = null, string $method = 'POST', array $attributes = [] ) : string
$action string
$method string
$attributes array
return string

openSecureForFiles() public method

Open a HTML form that accepts file uploads with a HTTPS action URI.
public openSecureForFiles ( string $action = null, string $method = 'POST', array $attributes = [] ) : string
$action string
$method string
$attributes array
return string

optgroup() protected method

Create a HTML select element optgroup.
protected optgroup ( array $options, string $label, string $selected ) : string
$options array
$label string
$selected string
return string

option() protected method

Create a HTML select element option.
protected option ( string $value, string $display, string $selected ) : string
$value string
$display string
$selected string
return string

password() public method

Create a HTML password input element.
public password ( string $name, array $attributes = [] ) : string
$name string
$attributes array
return string

radio() public method

Create a HTML radio button input element.
public radio ( string $name, string $value = null, boolean $checked = false, array $attributes = [] ) : string
$name string
$value string
$checked boolean
$attributes array
return string

reset() public method

Create a HTML reset input element.
public reset ( string $value = null, array $attributes = [] ) : string
$value string
$attributes array
return string

select() public method

Create a HTML select element.
public select ( string $name, array $options = [], string $selected = null, array $attributes = [] ) : string
$name string
$options array
$selected string
$attributes array
return string

submit() public method

Create a HTML submit input element.
public submit ( string $value = null, array $attributes = [] ) : string
$value string
$attributes array
return string

telephone() public method

Create a HTML telephone input element.
public telephone ( string $name, string $value = null, array $attributes = [] ) : string
$name string
$value string
$attributes array
return string

text() public method

Create a HTML text input element.
public text ( string $name, string $value = null, array $attributes = [] ) : string
$name string
$value string
$attributes array
return string

textarea() public method

Create a HTML textarea element.
public textarea ( string $name, string $value = '', array $attributes = [] ) : string
$name string
$value string
$attributes array
return string

token() public method

Generate a hidden field containing the current CSRF token.
public token ( ) : string
return string

url() public method

Create a HTML URL input element.
public url ( string $name, string $value = null, array $attributes = [] ) : string
$name string
$value string
$attributes array
return string

Property Details

$encoding protected property

The encoding to use.
protected string $encoding
return string

$html protected property

The HTML helper
protected HTML,LaravelBook\Laravel4Powerpack $html
return HTML

$labels public property

All of the label names that have been created.
public array $labels
return array

$macros public property

The registered custom macros.
public array $macros
return array

$spoofer public property

The request spoofer.
public string $spoofer
return string

$url protected property

The url generator instance
protected UrlGenerator,Illuminate\Routing $url
return Illuminate\Routing\UrlGenerator