Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Form_Element_Captcha Class Reference

Public Member Functions

 getCaptcha ()
 Get captcha adapter.
 
 setCaptcha ($captcha, $options=array())
 Set captcha adapter.
 
 __construct ($spec, $options=null)
 Constructor.
 
 setOptions (array $options)
 Set options.
 
 render (Zend_View_Interface $view=null)
 Render form element.
 
 getPluginLoader ($type)
 Retrieve plugin loader for validator or filter chain.
 
 addPrefixPath ($prefix, $path, $type=null)
 Add prefix path for plugin loader for captcha adapters.
 
 loadDefaultDecorators ()
 Load default decorators.
 
 isValid ($value, $context=null)
 Is the captcha valid?
 

Public Attributes

const CAPTCHA = 'CAPTCHA'
 Captcha plugin type constant.
 

Protected Attributes

 $_captcha
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Form_Element
static resolveElementId (Zend_Form_Decorator_Interface $decorator)
 Used to resolve and return an element ID.
 
- Protected Member Functions inherited from Zend_Form_Element
 _filterValue (&$value, &$key)
 Filter a value.
 
 _getDecorator ($name, $options)
 Instantiate a decorator based on class name or class name fragment.
 
 _loadFilter (array $filter)
 Lazy-load a filter.
 
 _loadValidator (array $validator)
 Lazy-load a validator.
 
 _loadDecorator (array $decorator, $name)
 Lazy-load a decorator.
 
 _getErrorMessages ()
 Retrieve error messages and perform translation and value substitution.
 
 _hasErrorMessages ()
 Are there custom error messages registered?
 

Constructor & Destructor Documentation

__construct (   $spec,
  $options = null 
)

Constructor.

$spec may be:

  • string: name of element
  • array: options with which to configure element
  • Zend_Config: Zend_Config with options for configuring element
Parameters
string | array | Zend_Config$spec
Returns
void

Member Function Documentation

addPrefixPath (   $prefix,
  $path,
  $type = null 
)

Add prefix path for plugin loader for captcha adapters.

This method handles the captcha type, the rest is handled by the parent

Parameters
string$prefix
string$path
string$type
Returns
Zend_Form_Element
See Also
Zend_Form_Element::addPrefixPath
getCaptcha ( )

Get captcha adapter.

Returns
Zend_Captcha_Adapter
getPluginLoader (   $type)

Retrieve plugin loader for validator or filter chain.

Support for plugin loader for Captcha adapters

Parameters
string$type
Returns
Zend_Loader_PluginLoader
Exceptions
Zend_Loader_Exceptionon invalid type.
isValid (   $value,
  $context = null 
)

Is the captcha valid?

Parameters
mixed$value
mixed$context
Returns
boolean
loadDefaultDecorators ( )

Load default decorators.

Returns
Zend_Form_Element_Captcha
render ( Zend_View_Interface  $view = null)

Render form element.

Parameters
Zend_View_Interface$view
Returns
string
setCaptcha (   $captcha,
  $options = array() 
)

Set captcha adapter.

Parameters
string | array | Zend_Captcha_Adapter$captcha
array$options
setOptions ( array  $options)

Set options.

Overrides to allow passing captcha options

Parameters
array$options
Returns
Zend_Form_Element_Captcha

Member Data Documentation

$_captcha
protected
const CAPTCHA = 'CAPTCHA'

Captcha plugin type constant.