Properties

$customValidationCode

$customValidationCode : mixed||string|int

Javascript performing additional validation of this element data

This property contains a list of Javascript snippets that will be sent to APIForm::renderValidationJS(). NB: All elements are added to the output one after the other, so don't forget to add a ";" after each to ensure no Javascript syntax error is generated.

Type

mixed||string|int — ()

$_name

$_name : 

"name" attribute of the element

Type

$_caption

$_caption : 

caption of the element

Type

$_accesskey

$_accesskey : 

Accesskey for this element

Type

$_class

$_class : mixed||string|int

HTML classes for this element

Type

mixed||string|int —

$_hidden

$_hidden : 

hidden?

Type

$_extra

$_extra : mixed||string|int

extra attributes to go in the tag

Type

mixed||string|int —

$_required

$_required : 

required field?

Type

$_description

$_description : 

description of the field

Type

$_nocolspan

$_nocolspan : 

CAtzwolf: Modified for No Colspan

Lets a developer have only one column in a form element rather than two. Example of usgage: Allows text editors to span 2 columns rathe than pushed into one column

Type

$_formtype

$_formtype : 

Get form type

Type

$_options

$_options : mixed||string|int

Availlable options

Type

mixed||string|int —

$_value

$_value : mixed||string|int

pre-selected values in array

Type

mixed||string|int —

$_delimeter

$_delimeter : 

HTML to seperate the elements

Type

$columns

$columns : 

Columns per line for rendering Leave unset (null) to put all options in one line Set to 1 to put each option on its own line Any other positive integer 'n' to put 'n' options on each line

Type

Methods

__construct()

__construct(  caption,   name,   value = null,   delimeter =  ) : 

Constructor

Parameters

caption
name
value

Either one value as a string or an array of them.

delimeter

Returns

isContainer()

isContainer() : 

Is this element a container of other elements?

Returns

false

setName()

setName(  name) : 

set the "name" attribute for the element

Parameters

name

"name" attribute for the element

Returns

getName()

getName(  encode = true) : 

get the "name" attribute for the element

Parameters

encode

Returns

"name" attribute

setAccessKey()

setAccessKey(  key) : 

set the "accesskey" attribute for the element

Parameters

key

"accesskey" attribute for the element

Returns

getAccessKey()

getAccessKey() : 

get the "accesskey" attribute for the element

Returns

"accesskey" attribute value

getAccessString()

getAccessString(  str) : 

If the accesskey is found in the specified string, underlines it

Parameters

str

String where to search the accesskey occurence

Returns

Enhanced string with the 1st occurence of accesskey underlined

setClass()

setClass(  class) : 

set the "class" attribute for the element

Parameters

class

Returns

getClass()

getClass() : 

get the "class" attribute for the element

Returns

"class" attribute value

setCaption()

setCaption(  caption) : 

set the caption for the element

Parameters

caption

Returns

getCaption()

getCaption(  encode = false) : 

get the caption for the element

Parameters

encode

To sanitizer the text?

Returns

getTitle()

getTitle(  encode = true) : 

get the caption for the element

Parameters

encode

To sanitizer the text?

Returns

setDescription()

setDescription(  description) : 

set the element's description

Parameters

description

Returns

getDescription()

getDescription(  encode = false) : 

get the element's description

Parameters

encode

To sanitizer the text?

Returns

setHidden()

setHidden() : 

flag the element as "hidden"

Returns

isHidden()

isHidden() : 

Find out if an element is "hidden".

Returns

isRequired()

isRequired() : 

Find out if an element is required.

Returns

setExtra()

setExtra(  extra,   replace = false) : mixed||string|int

Add extra attributes to the element.

This string will be inserted verbatim and unvalidated in the element's tag. Know what you are doing!

Parameters

extra
replace

If true, passed string will replace current content otherwise it will be appended to it

Returns

mixed||string|int —

New content of the extra string

getExtra()

getExtra(  encode = false) : 

Get the extra attributes for the element

Parameters

encode

To sanitizer the text?

Returns

setNocolspan()

setNocolspan(  nocolspan = true) : 

Set the element's nocolspan Modified by Catzwolf

Parameters

nocolspan

Returns

getNocolspan()

getNocolspan() : 

Get the element's nocolspan Modified by Catzwolf

Returns

getFormType()

getFormType() : 

get the element's nocolspan Modified by Catzwolf

Returns

setFormType()

setFormType(  value) : 

set the element's nocolspan Modified by Catzwolf

Parameters

value

Returns

renderValidationJS()

renderValidationJS() : 

Render custom javascript validation code

Returns

render()

render() : 

prepare HTML for output

This method is abstract and must be overwritten by the child classes.

Returns

getValue()

getValue(  encode = false) : mixed||string|int

Get the "value"

Parameters

encode

To sanitizer the text?

Returns

mixed||string|int —

setValue()

setValue(mixed||string|int  value) : 

Set the "value"

Parameters

mixed||string|int value

Returns

addOption()

addOption(  value,   name) : 

Add an option

Parameters

value
name

Returns

addOptionArray()

addOptionArray(mixed||string|int  options) : 

Add multiple Options at once

Parameters

mixed||string|int options

Associative array of value->name pairs

Returns

getOptions()

getOptions(bool|int  encode = false) : mixed||string|int

Get an array with all the options

Parameters

bool|int encode

To sanitizer the text? potential values: 0 - skip; 1 - only for value; 2 - for both value and name

Returns

mixed||string|int —

Associative array of value->name pairs

getDelimeter()

getDelimeter(  encode = false) : 

Get the delimiter of this group

Parameters

encode

To sanitizer the text?

Returns

The delimiter