\Pluf_Form_Widget_FileInput

Simple input of type file.

Summary

Methods
Properties
Constants
render()
__construct()
valueFromFormData()
idForLabel()
$is_hidden
$needs_multipart_form
$input_type
$attrs
No constants found
buildAttrs()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$is_hidden

$is_hidden : 

Type

$needs_multipart_form

$needs_multipart_form : 

Type

$input_type

$input_type : 

Type

$attrs

$attrs : 

Type

Methods

render()

render(  $name,   $value,   $extra_attrs = array()) : string

Renders the HTML of the input.

Parameters

$name
$value
$extra_attrs

Returns

string —

The HTML string of the input.

__construct()

__construct(  $attrs = array()) 

Parameters

$attrs

valueFromFormData()

valueFromFormData(  $name,   $data) : mixed

A widget can split itself in multiple input form. For example you can have a datetime value in your model and you use 2 inputs one for the date and one for the time to input the value. So the widget must know how to get back the values from the submitted form.

Parameters

$name
$data

Returns

mixed —

Value or null if not defined.

idForLabel()

idForLabel(  $id) 

Returns the HTML ID attribute of this Widget for use by a <label>, given the ID of the field. Returns None if no ID is available.

This hook is necessary because some widgets have multiple HTML elements and, thus, multiple IDs. In that case, this method should return an ID value that corresponds to the first ID in the widget's tags.

Parameters

$id

buildAttrs()

buildAttrs(  $attrs,   $extra_attrs = array()) : array

Build the list of attributes for the form.

It should be called this way: $this->buildAttrs(array('name'=>$name, 'type'=>$this->input_type), $extra_attrs);

Parameters

$attrs
$extra_attrs

Returns

array —

The attributes for the field.