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

Class: HTML_QuickForm2_Factory

Source Location: /HTML_QuickForm2-2.0.2/HTML/QuickForm2/Factory.php

Class Overview


Static factory class


Author(s):

Version:

  • Release: 2.0.2

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 64]
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', null),'checkbox'=>array('HTML_QuickForm2_Element_InputCheckbox',null),'date'=>array('HTML_QuickForm2_Element_Date',null),'fieldset'=>array('HTML_QuickForm2_Container_Fieldset',null),'group'=>array('HTML_QuickForm2_Container_Group',null),'file'=>array('HTML_QuickForm2_Element_InputFile',null),'hidden'=>array('HTML_QuickForm2_Element_InputHidden',null),'hierselect'=>array('HTML_QuickForm2_Element_Hierselect',null),'image'=>array('HTML_QuickForm2_Element_InputImage',null),'inputbutton'=>array('HTML_QuickForm2_Element_InputButton',null),'password'=>array('HTML_QuickForm2_Element_InputPassword',null),'radio'=>array('HTML_QuickForm2_Element_InputRadio',null),'repeat'=>array('HTML_QuickForm2_Container_Repeat',null),'reset'=>array('HTML_QuickForm2_Element_InputReset',null),'script'=>array('HTML_QuickForm2_Element_Script',null),'select'=>array('HTML_QuickForm2_Element_Select',null),'static'=>array('HTML_QuickForm2_Element_Static',null),'submit'=>array('HTML_QuickForm2_Element_InputSubmit',null),'text'=>array('HTML_QuickForm2_Element_InputText',null),'textarea'=>array('HTML_QuickForm2_Element_Textarea',null))

[line 70]

List of element types known to Factory
  • Access: protected

Type:   array


[ Top ]

$registeredRules = array(
        'nonempty'      => array('HTML_QuickForm2_Rule_Nonempty', null),'empty'=>array('HTML_QuickForm2_Rule_Empty',null),'required'=>array('HTML_QuickForm2_Rule_Required',null),'compare'=>array('HTML_QuickForm2_Rule_Compare',null),'eq'=>array('HTML_QuickForm2_Rule_Compare',null,array('operator'=>'===')),'neq'=>array('HTML_QuickForm2_Rule_Compare',null,array('operator'=>'!==')),'lt'=>array('HTML_QuickForm2_Rule_Compare',null,array('operator'=>'<')),'lte'=>array('HTML_QuickForm2_Rule_Compare',null,array('operator'=>'<=')),'gt'=>array('HTML_QuickForm2_Rule_Compare',null,array('operator'=>'>')),'gte'=>array('HTML_QuickForm2_Rule_Compare',null,array('operator'=>'>=')),'regex'=>array('HTML_QuickForm2_Rule_Regex',null),'callback'=>array('HTML_QuickForm2_Rule_Callback',null),'length'=>array('HTML_QuickForm2_Rule_Length',null),'minlength'=>array('HTML_QuickForm2_Rule_Length',null,array('max'=>0)),'maxlength'=>array('HTML_QuickForm2_Rule_Length',null,array('min'=>0)),'maxfilesize'=>array('HTML_QuickForm2_Rule_MaxFileSize',null),'mimetype'=>array('HTML_QuickForm2_Rule_MimeType',null),'each'=>array('HTML_QuickForm2_Rule_Each',null),'notcallback'=>array('HTML_QuickForm2_Rule_NotCallback',null),'notregex'=>array('HTML_QuickForm2_Rule_NotRegex',null),'email'=>array('HTML_QuickForm2_Rule_Email',null))

[line 97]

List of registered rules
  • Access: protected

Type:   array


[ Top ]



Method Detail

createElement   [line 169]

HTML_QuickForm2_Node createElement( string $type, [string $name = null], [string|array $attributes = null], [ $data = array()])

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)
string   $name     Element name (passed to element's constructor)
string|array   $attributes     Element attributes (passed to element's constructor)
array   $data     Element-specific data (passed to element's constructor)

[ Top ]

createRule   [line 224]

HTML_QuickForm2_Rule createRule( string $type, HTML_QuickForm2_Node $owner, [string $message = ''], [mixed $config = null])

Creates a new Rule of the given type
  • Return: A created Rule
  • Throws: HTML_QuickForm2_InvalidArgumentException If rule type is unknown
  • Throws: HTML_QuickForm2_NotFoundException If class for the rule can't be found and/or loaded from file
  • Access: public

Parameters:

string   $type     Rule type name (treated case-insensitively)
HTML_QuickForm2_Node   $owner     Element to validate by the rule
string   $message     Message to display if validation fails
mixed   $config     Configuration data for the rule

[ Top ]

isElementRegistered   [line 150]

bool isElementRegistered( string $type)

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

Parameters:

string   $type     Type name (treated case-insensitively)

[ Top ]

isRuleRegistered   [line 205]

bool isRuleRegistered( string $type)

Checks whether a rule type is known to Factory
  • Access: public

Parameters:

string   $type     Rule type name (treated case-insensitively)

[ Top ]

registerElement   [line 137]

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 ]

registerRule   [line 191]

void registerRule( string $type, string $className, [string $includeFile = null], [mixed $config = null])

Registers a new rule type
  • Access: public

Parameters:

string   $type     Rule type name (treated case-insensitively)
string   $className     Class name
string   $includeFile     File containing the class, leave empty if class already loaded
mixed   $config     Configuration data for rules of the given type

[ Top ]


Documentation generated on Sat, 28 Jun 2014 09:30:17 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.