PHP Class FOF30\Form\Header\HeaderBase

Since: 2.0
Show file Open project: akeeba/fof

Protected Properties

Property Type Description
$buttons string | null The buttons HTML.
$description string The description text for the form field. Usually used in tooltips.
$element SimpleXMLElement The SimpleXMLElement object of the XML element that describes the header field.
$fieldname string The name of the field.
$filter string | null The filter HTML.
$filterFieldName mixed The name of the filter field
$filterSource mixed The key of the filter value in the model state.
$form FOF30\Form\Form The Form object of the form attached to the header field.
$group string The group of the field.
$header string | null The header HTML.
$label string The label for the header field.
$name string The name of the form field.
$onlyFilter boolean Should we ignore the header (have the field act as just a filter)?
$options array | null The options for a drop-down filter.
$sortable boolean Is this a sortable column?
$tdwidth mixed The intended table data width (in pixels or percent).
$type string The form field type.
$value mixed The value of the filter.

Public Methods

Method Description
__construct ( Form $form = null ) Method to instantiate the form field object.
__get ( string $name ) : mixed Method to get certain otherwise inaccessible properties from the form field object.
setForm ( Form $form ) : FOF30\Form\HeaderInterface Method to attach a JForm object to the field.
setup ( SimpleXMLElement $element, string $group = null ) : boolean Method to attach a Form object to the field.

Protected Methods

Method Description
getButtons ( ) : string | null Returns the HTML for the buttons to be rendered in the filter row, next to the text input filter, or null if this element should render no text input filter buttons.
getFieldName ( string $fieldName ) : string Method to get the field name used.
getFilter ( ) : string | null Returns the HTML for a text filter to be rendered in the filter row, or null if this element should render no text input filter.
getFilterFieldName ( string $filterFieldName ) : string Return the name of the filter field
getFilterSource ( string $filterSource ) : string Return the key of the filter value in the model state or, if it's not set, the name of the field.
getHeader ( ) : string | null Returns the HTML for the header row, or null if this element should render no header element
getId ( string $fieldId, string $fieldName ) : string Method to get the id used for the field input tag.
getLabel ( ) : string Method to get the field label.
getName ( string $fieldName ) : string Method to get the name used for the field input tag.
getOptions ( ) : array Returns the JHtml options for a drop-down filter. Do not include an empty option, it is added automatically.
getSortable ( ) : boolean Is this a sortable field?
getValue ( ) : mixed Get the filter value for this header field

Method Details

__construct() public method

Method to instantiate the form field object.
Since: 2.0
public __construct ( Form $form = null )
$form FOF30\Form\Form The form to attach to the form field object.

__get() public method

Method to get certain otherwise inaccessible properties from the form field object.
Since: 2.0
public __get ( string $name ) : mixed
$name string The property name for which to the the value.
return mixed The property value or null.

getButtons() protected method

Returns the HTML for the buttons to be rendered in the filter row, next to the text input filter, or null if this element should render no text input filter buttons.
Since: 2.0
protected getButtons ( ) : string | null
return string | null HTML code or null if nothing is to be rendered

getFieldName() protected method

Method to get the field name used.
Since: 2.0
protected getFieldName ( string $fieldName ) : string
$fieldName string The field element name.
return string The field name

getFilter() protected method

Returns the HTML for a text filter to be rendered in the filter row, or null if this element should render no text input filter.
Since: 2.0
protected getFilter ( ) : string | null
return string | null HTML code or null if nothing is to be rendered

getFilterFieldName() protected method

Return the name of the filter field
protected getFilterFieldName ( string $filterFieldName ) : string
$filterFieldName string The filter field name source value to return
return string

getFilterSource() protected method

Return the key of the filter value in the model state or, if it's not set, the name of the field.
protected getFilterSource ( string $filterSource ) : string
$filterSource string The filter source value to return
return string

getHeader() protected method

Returns the HTML for the header row, or null if this element should render no header element
Since: 2.0
protected getHeader ( ) : string | null
return string | null HTML code or null if nothing is to be rendered

getId() protected method

Method to get the id used for the field input tag.
Since: 2.0
protected getId ( string $fieldId, string $fieldName ) : string
$fieldId string The field element id.
$fieldName string The field element name.
return string The id to be used for the field input tag.

getLabel() protected method

Method to get the field label.
Since: 2.0
protected getLabel ( ) : string
return string The field label.

getName() protected method

Method to get the name used for the field input tag.
Since: 2.0
protected getName ( string $fieldName ) : string
$fieldName string The field element name.
return string The name to be used for the field input tag.

getOptions() protected method

Returns the JHtml options for a drop-down filter. Do not include an empty option, it is added automatically.
Since: 2.0
protected getOptions ( ) : array
return array The JHtml options for a drop-down filter

getSortable() protected method

Is this a sortable field?
protected getSortable ( ) : boolean
return boolean True if it's sortable

getValue() protected method

Get the filter value for this header field
protected getValue ( ) : mixed
return mixed The filter value

setForm() public method

Method to attach a JForm object to the field.
Since: 2.0
public setForm ( Form $form ) : FOF30\Form\HeaderInterface
$form FOF30\Form\Form The JForm object to attach to the form field.
return FOF30\Form\HeaderInterface The form field object so that the method can be used in a chain.

setup() public method

Method to attach a Form object to the field.
Since: 2.0
public setup ( SimpleXMLElement $element, string $group = null ) : boolean
$element SimpleXMLElement The SimpleXMLElement object representing the tag for the form field object.
$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.

Property Details

$buttons protected property

The buttons HTML.
Since: 2.0
protected string|null $buttons
return string | null

$description protected property

The description text for the form field. Usually used in tooltips.
Since: 2.0
protected string $description
return string

$element protected property

The SimpleXMLElement object of the XML element that describes the header field.
Since: 2.0
protected SimpleXMLElement $element
return SimpleXMLElement

$fieldname protected property

The name of the field.
Since: 2.0
protected string $fieldname
return string

$filter protected property

The filter HTML.
Since: 2.0
protected string|null $filter
return string | null

$filterFieldName protected property

The name of the filter field
Since: 3.0
protected mixed $filterFieldName
return mixed

$filterSource protected property

The key of the filter value in the model state.
Since: 2.0
protected mixed $filterSource
return mixed

$form protected property

The Form object of the form attached to the header field.
Since: 2.0
protected Form,FOF30\Form $form
return FOF30\Form\Form

$group protected property

The group of the field.
Since: 2.0
protected string $group
return string

$header protected property

The header HTML.
Since: 2.0
protected string|null $header
return string | null

$label protected property

The label for the header field.
Since: 2.0
protected string $label
return string

$name protected property

The name of the form field.
Since: 2.0
protected string $name
return string

$onlyFilter protected property

Should we ignore the header (have the field act as just a filter)?
Since: 3.0
protected bool $onlyFilter
return boolean

$options protected property

The options for a drop-down filter.
Since: 2.0
protected array|null $options
return array | null

$sortable protected property

Is this a sortable column?
Since: 2.0
protected bool $sortable
return boolean

$tdwidth protected property

The intended table data width (in pixels or percent).
Since: 2.0
protected mixed $tdwidth
return mixed

$type protected property

The form field type.
Since: 2.0
protected string $type
return string

$value protected property

The value of the filter.
Since: 2.0
protected mixed $value
return mixed