PHP Interface FOF30\Form\FieldInterface

Show file Open project: akeeba/fof

Public Methods

Method Description
getAttribute ( string $name, mixed $default = null ) : mixed Method to get an attribute of the field
getRepeatable ( ) : string Get the rendering of this field type for a repeatable (grid) display, e.g. in a view listing many item (typically a "browse" task)
getStatic ( ) : string Get the rendering of this field type for static display, e.g. in a single item view (typically a "read" task).
renderField ( array $options = [] ) : string Method to get a control group with label and input.
setForm ( JForm $form ) : FOF30\Form\FieldInterface Method to attach a JForm object to the field. Actually, we need a FOF Form object but there's no way to provide that type hint without issuing a string standards notice in PHP :(
setValue ( mixed $value ) : void Simple method to set the value
setup ( SimpleXMLElement $element, mixed $value, string $group = null ) : boolean Method to attach a Form object to the field.

Method Details

getAttribute() public method

Method to get an attribute of the field
public getAttribute ( string $name, mixed $default = null ) : mixed
$name string Name of the attribute to get
$default mixed Optional value to return if attribute not found
return mixed Value of the attribute / default

getRepeatable() public method

Get the rendering of this field type for a repeatable (grid) display, e.g. in a view listing many item (typically a "browse" task)
Since: 2.0
public getRepeatable ( ) : string
return string The field HTML

getStatic() public method

Get the rendering of this field type for static display, e.g. in a single item view (typically a "read" task).
Since: 2.0
public getStatic ( ) : string
return string The field HTML

renderField() public method

Method to get a control group with label and input.
public renderField ( array $options = [] ) : string
$options array Options to be passed into the rendering of the field
return string A string containing the html for the control group

setForm() public method

Method to attach a JForm object to the field. Actually, we need a FOF Form object but there's no way to provide that type hint without issuing a string standards notice in PHP :(
public setForm ( JForm $form ) : FOF30\Form\FieldInterface
$form JForm The JForm object to attach to the form field.
return FOF30\Form\FieldInterface The form field object so that the method can be used in a chain.

setValue() public method

Simple method to set the value
public setValue ( mixed $value ) : void
$value mixed Value to set
return void

setup() public method

Method to attach a Form object to the field.
public setup ( SimpleXMLElement $element, mixed $value, string $group = null ) : boolean
$element SimpleXMLElement The SimpleXMLElement object representing the tag for the form field object.
$value mixed The form field value to validate.
$group string The field name group control value. This acts as as an array container for the field. For example if the field has name="foo" and the group value is set to "bar" then the full field name would end up being "bar[foo]".
return boolean True on success.