HTML_QuickForm2
[ class tree: HTML_QuickForm2 ] [ index: HTML_QuickForm2 ] [ all elements ]

Class: HTML_QuickForm2_Node

Source Location: /HTML_QuickForm2-0.1.0/QuickForm2/Node.php

Class Overview

HTML_Common2
   |
   --HTML_QuickForm2_Node

Abstract base class for all QuickForm2 Elements and Containers


Author(s):

Version:

  • Release: 0.1.0

Variables

Methods


Child classes:

HTML_QuickForm2_Container
Abstract base class for simple QuickForm2 containers
HTML_QuickForm2_Element
Abstract base class for simple QuickForm2 elements (not Containers)

Inherited Variables

Inherited Methods


Class Details

[line 69]
Abstract base class for all QuickForm2 Elements and Containers

This class is mostly here to define the interface that should be implemented by the subclasses. It also contains static methods handling generation of unique ids for elements which do not have ids explicitly set.



[ Top ]


Class Variables

$container =  null

[line 99]

Element containing current
  • Access: protected



[ Top ]

$data =  null

[line 105]

Contains options and data used for the element creation
  • Access: protected

Type:   array


[ Top ]

$frozen =  false

[line 87]

Element's "frozen" status
  • Access: protected

Type:   boolean


[ Top ]

$ids = array()

[line 75]

Array containing the parts of element ids
  • Access: protected

Type:   array


[ Top ]

$label =  null

[line 81]

Label(s) for the element
  • Access: protected

Type:   string|array


[ Top ]

$persistent =  false

[line 93]

Whether element's value should persist when element is frozen
  • Access: protected

Type:   boolean


[ Top ]



Method Detail

__construct (Constructor)   [line 116]

HTML_QuickForm2_Node __construct( [string $name = null], [array $data = null], [mixed $label = null], [mixed $attributes = null])

Class constructor
  • Access: public

Overridden in child classes as:

HTML_QuickForm2::__construct()
Class constructor, form's "id" and "method" attributes can only be set here
HTML_QuickForm2_Element_Select::__construct()
Class constructor
HTML_QuickForm2_Element_InputCheckbox::__construct()

Parameters:

string   $name   —  Element name
array   $data   —  Element data (options and data useful for the element creation)
mixed   $label   —  Label for the element (may be an array of labels)
mixed   $attributes   —  Attributes (either a string or an array)

[ Top ]

generateId   [line 143]

string generateId( string $elementName)

Generates an id for the element

Called when an element is created without explicitly given id

  • Return: The generated element id
  • Access: protected

Parameters:

string   $elementName   —  Element name

[ Top ]

getContainer   [line 361]

HTML_QuickForm2_Container|null getContainer( )

Returns the element containing current
  • Access: public

[ Top ]

getDataSources   [line 371]

array getDataSources( )

Returns the data sources for this element
  • Access: protected

Overridden in child classes as:

HTML_QuickForm2::getDataSources()
Returns the list of data sources attached to the form

[ Top ]

getId   [line 233]

string getId( )

Returns the element's id
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container::getId()
HTML_QuickForm2_Element::getId()

[ Top ]

getLabel   [line 269]

string|array getLabel( )

Returns the element's label(s)
  • Access: public

[ Top ]

getName   [line 217]

string getName( )

Returns the element's name
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container::getName()
HTML_QuickForm2_Container_Fieldset::getName()
HTML_QuickForm2_Element::getName()

[ Top ]

getType   [line 209]


getValue   [line 253]

mixed getValue( )

Returns the element's value
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container::getValue()
Returns the element's value
HTML_QuickForm2_Element_Textarea::getValue()
HTML_QuickForm2_Element_Select::getValue()
Returns the value of the <select> element
HTML_QuickForm2_Element_Input::getValue()
HTML_QuickForm2_Element_InputReset::getValue()
Reset elements cannot have any submit values
HTML_QuickForm2_Element_InputSubmit::getValue()
Returns the element's value
HTML_QuickForm2_Element_InputFile::getValue()
Returns the information on uploaded file
HTML_QuickForm2_Element_InputCheckable::getValue()
HTML_QuickForm2_Element_InputImage::getValue()
Returns the element's value
HTML_QuickForm2_Element_InputButton::getValue()
Button elements cannot have any submit values
HTML_QuickForm2_Element_Button::getValue()
Returns the element's value

[ Top ]

persistentFreeze   [line 315]

bool persistentFreeze( [bool $persistent = null])

Changes the element's persistent freeze behaviour

If persistent freeze is on, the element's value will be kept (and submitted) in a hidden field when the element is frozen.

  • Return: Old value of "persistent freeze" flag
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container::persistentFreeze()

Parameters:

bool   $persistent   —  New value for "persistent freeze". If omitted, the method will not set anything, just return the current value of the flag.

[ Top ]

setContainer   [line 334]

void setContainer( [HTML_QuickForm2_Container $container = null])

Adds the link to the element containing current
  • Throws: HTML_QuickForm2_InvalidArgumentException If trying to set a child of an element as its container
  • Access: protected

Overridden in child classes as:

HTML_QuickForm2::setContainer()

Parameters:

HTML_QuickForm2_Container   $container   —  Element containing the current one, null if the link should really be removed (if removing from container)

[ Top ]

setId   [line 245]

void setId( [string $id = null])

Sets the elements id

Please note that elements should always have an id in QuickForm2 and therefore it will not be possible to remove the element's id or set it to an empty value. If id is not explicitly given, it will be autogenerated.

  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container::setId()
HTML_QuickForm2::setId()
HTML_QuickForm2_Element::setId()

Parameters:

string   $id   —  Element's id, will be autogenerated if not given

[ Top ]

setLabel   [line 280]

void setLabel( string|array $label)

Sets the element's label(s)
  • Access: public

Parameters:

string|array   $label   —  Label for the element (may be an array of labels)

[ Top ]

setName   [line 225]

void setName( string $name)

Sets the element's name
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container::setName()
HTML_QuickForm2_Container_Fieldset::setName()
HTML_QuickForm2_Element::setName()

Parameters:

string   $name   — 

[ Top ]

setValue   [line 261]

void setValue( mixed $value)

Sets the element's value
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm2::setValue()
HTML_QuickForm2_Container_Fieldset::setValue()
HTML_QuickForm2_Element_Textarea::setValue()
HTML_QuickForm2_Element_Select::setValue()
HTML_QuickForm2_Element_Input::setValue()
HTML_QuickForm2_Element_InputReset::setValue()
Reset elements cannot have any submit values
HTML_QuickForm2_Element_InputSubmit::setValue()
Submit's value cannot be set via this method
HTML_QuickForm2_Element_InputFile::setValue()
File upload's value cannot be set here
HTML_QuickForm2_Element_InputCheckable::setValue()
HTML_QuickForm2_Element_InputImage::setValue()
Image button's value cannot be set via this method
HTML_QuickForm2_Element_InputButton::setValue()
Button elements cannot have any submit values
HTML_QuickForm2_Element_Button::setValue()
Button's value cannot be set via this method

Parameters:

mixed   $value   — 

[ Top ]

storeId   [line 189]

void storeId( string $id)

Stores the explicitly given id to prevent duplicate id generation
  • Access: protected

Parameters:

string   $id   —  Element id

[ Top ]

toggleFrozen   [line 294]

bool toggleFrozen( [bool $freeze = null])

Changes the element's frozen status
  • Return: Old value of element's frozen status
  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Container::toggleFrozen()
HTML_QuickForm2_Element_InputHidden::toggleFrozen()
Hidden elements can not be frozen
HTML_QuickForm2_Element_InputReset::toggleFrozen()
Reset buttons can not be frozen
HTML_QuickForm2_Element_InputSubmit::toggleFrozen()
Submit buttons can not be frozen
HTML_QuickForm2_Element_InputFile::toggleFrozen()
File upload elements cannot be frozen
HTML_QuickForm2_Element_InputImage::toggleFrozen()
Image buttons can not be frozen
HTML_QuickForm2_Element_InputButton::toggleFrozen()
Buttons can not be frozen
HTML_QuickForm2_Element_Button::toggleFrozen()
Buttons can not be frozen

Parameters:

bool   $freeze   —  Whether the element should be frozen or editable. If omitted, the method will not change the frozen status, just return its current value

[ Top ]

updateValue   [line 383]

void updateValue( )

Called when the element needs to update its value from form's data sources
  • Abstract:
  • Access: protected

Overridden in child classes as:

HTML_QuickForm2_Container::updateValue()
Called when the element needs to update its value from form's data sources
HTML_QuickForm2_Element::updateValue()
Called when the element needs to update its value from form's data sources
HTML_QuickForm2_Element_Select::updateValue()
HTML_QuickForm2_Element_InputSubmit::updateValue()
HTML_QuickForm2_Element_InputFile::updateValue()
HTML_QuickForm2_Element_InputCheckbox::updateValue()
HTML_QuickForm2_Element_InputImage::updateValue()
HTML_QuickForm2_Element_Button::updateValue()

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:00:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.