\Pop\FormFields

Form fields class

Summary

Methods
Properties
Constants
__construct()
factory()
addFieldsFromTable()
addFields()
setFieldAttribute()
setFieldAttributes()
getFields()
__set()
__get()
__isset()
__unset()
offsetExists()
offsetGet()
offsetSet()
offsetUnset()
No public properties found
No constants found
No protected methods found
$fields
N/A
No private methods found
No private properties found
N/A

Properties

$fields

$fields : array

Fields array

Type

array

Methods

__construct()

__construct(mixed  $fields = null, array  $attribs = null, array  $values = null, mixed  $omit = null) : \Pop\Form\Fields

Constructor

Instantiate the fields object

Parameters

mixed $fields
array $attribs
array $values
mixed $omit

Returns

\Pop\Form\Fields

factory()

factory(string  $name, array  $field, array  $values = null) : \Pop\Form\Element\AbstractElement

Static factory method to create a field element object from a field config array

Parameters

string $name
array $field
array $values

Throws

\Pop\Form\Exception

Returns

\Pop\Form\Element\AbstractElement

addFieldsFromTable()

addFieldsFromTable(array  $tableInfo, array  $attribs = null, array  $values = null, mixed  $omit = null) : \Pop\Form\Fields

Add form fields from a related database table. The $tableInfo parameter should be the returned array result from calling the static Pop\Db\Record method, Record::getTableInfo();

Parameters

array $tableInfo
array $attribs
array $values
mixed $omit

Throws

\Pop\Form\Exception

Returns

\Pop\Form\Fields

addFields()

addFields(array  $fields) : \Pop\Form\Fields

Add form fields

Parameters

array $fields

Returns

\Pop\Form\Fields

setFieldAttribute()

setFieldAttribute(string  $field, string  $attrib, string  $value) : \Pop\Form\Fields

Set form field config attribute

Parameters

string $field
string $attrib
string $value

Returns

\Pop\Form\Fields

setFieldAttributes()

setFieldAttributes(string  $field, array  $attribs) : \Pop\Form\Fields

Set form field config attributes

Parameters

string $field
array $attribs

Returns

\Pop\Form\Fields

getFields()

getFields() : array

Get the form fields

Returns

array

__set()

__set(string  $name, mixed  $value) : void

Set method to set the property to the value of fields[$name]

Parameters

string $name
mixed $value

Throws

\Pop\Form\Exception

__get()

__get(string  $name) : mixed

Get method to return the value of fields[$name]

Parameters

string $name

Throws

\Pop\Form\Exception

Returns

mixed

__isset()

__isset(string  $name) : boolean

Return the isset value of fields[$name]

Parameters

string $name

Returns

boolean

__unset()

__unset(string  $name) : void

Unset fields[$name].

Parameters

string $name

offsetExists()

offsetExists(mixed  $offset) : boolean

ArrayAccess offsetExists

Parameters

mixed $offset

Returns

boolean

offsetGet()

offsetGet(mixed  $offset) : mixed

ArrayAccess offsetGet

Parameters

mixed $offset

Returns

mixed

offsetSet()

offsetSet(mixed  $offset, mixed  $value) : void

ArrayAccess offsetSet

Parameters

mixed $offset
mixed $value

offsetUnset()

offsetUnset(mixed  $offset) : void

ArrayAccess offsetUnset

Parameters

mixed $offset