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

Class: HTML_QuickForm2_Factory

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

Class Overview


Static factory class


Author(s):

Version:

  • Release: 0.1.0

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 63]
Static factory class

The class handles instantiation of Element and Rule objects as well as registering of new Element and Rule classes.



[ Top ]


Class Variables

$elementTypes = array(
        'button'        => array('HTML_QuickForm2_Element_Button',
                                 'HTML/QuickForm2/Element/Button.php'),'checkbox'=>array('HTML_QuickForm2_Element_InputCheckbox','HTML/QuickForm2/Element/InputCheckbox.php'),'fieldset'=>array('HTML_QuickForm2_Container_Fieldset','HTML/QuickForm2/Container/Fieldset.php'),'file'=>array('HTML_QuickForm2_Element_InputFile','HTML/QuickForm2/Element/InputFile.php'),'hidden'=>array('HTML_QuickForm2_Element_InputHidden','HTML/QuickForm2/Element/InputHidden.php'),'image'=>array('HTML_QuickForm2_Element_InputImage','HTML/QuickForm2/Element/InputImage.php'),'inputbutton'=>array('HTML_QuickForm2_Element_InputButton','HTML/QuickForm2/Element/InputButton.php'),'password'=>array('HTML_QuickForm2_Element_InputPassword','HTML/QuickForm2/Element/InputPassword.php'),'radio'=>array('HTML_QuickForm2_Element_InputRadio','HTML/QuickForm2/Element/InputRadio.php'),'reset'=>array('HTML_QuickForm2_Element_InputReset','HTML/QuickForm2/Element/InputReset.php'),'select'=>array('HTML_QuickForm2_Element_Select','HTML/QuickForm2/Element/Select.php'),'submit'=>array('HTML_QuickForm2_Element_InputSubmit','HTML/QuickForm2/Element/InputSubmit.php'),'text'=>array('HTML_QuickForm2_Element_InputText','HTML/QuickForm2/Element/InputText.php'),'textarea'=>array('HTML_QuickForm2_Element_Textarea','HTML/QuickForm2/Element/Textarea.php'))

[line 69]

List of element types known to Factory
  • Access: protected

Type:   array


[ Top ]



Method Detail

createElement   [line 156]

HTML_QuickForm2_Node createElement( string $type, [mixed $name = null], [mixed $data = null], [mixed $label = null], [mixed $attributes = null])

Creates a new element object of the given type
  • Return: A created element
  • Throws: HTML_QuickForm2_InvalidArgumentException If type name is unknown
  • Throws: HTML_QuickForm2_NotFoundException If class for the element can not be found and/or loaded from file
  • Access: public

Parameters:

string   $type   —  Type name (treated case-insensitively)
mixed   $name   —  Element name (passed to element's constructor)
mixed   $data   —  Element-specific data (passed to element's constructor)
mixed   $label   —  Element label (passed to element's constructor)
mixed   $attributes   —  Element attributes (passed to element's constructor)

[ Top ]

fileExists   [line 107]

bool fileExists( string $fileName)

Checks whether the file exists in the include path
  • Access: protected

Parameters:

string   $fileName   —  file name

[ Top ]

isElementRegistered   [line 137]

bool isElementRegistered( string $type)

Checks whether an element type is known to factory
  • Access: public

Parameters:

string   $type   —  Type name (treated case-insensitively)

[ Top ]

registerElement   [line 125]

void registerElement( string $type, string $className, [string $includeFile = null])

Registers a new element type
  • Access: public

Parameters:

string   $type   —  Type name (treated case-insensitively)
string   $className   —  Class name
string   $includeFile   —  File containing the class, leave empty if class already loaded

[ Top ]


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