Form/Element/Captcha.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Form
- Subpackage
- Element
- Version
- $Id$
\Zend_Form_Element_Captcha
Package: Zend_Form\Element

Returns
Details
Returns
Throws





Returns
Generic captcha element
This element allows to insert CAPTCHA into the form in order
to validate that human is submitting the form. The actual
logic is contained in the captcha adapter.
- Parent(s)
- \Zend_Form_Element_Xhtml < \Zend_Form_Element
- See
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties
Methods

__construct(string | array | \Zend_Config $spec, $options = null) : voidConstructor
$spec may be:
- string: name of element
- array: options with which to configure element
- Zend_Config: Zend_Config with options for configuring element
Parameters| Name | Type | Description |
|---|---|---|
| $spec | string | array | \Zend_Config | |
| $options |

addPrefixPath(string $prefix, string $path, string $type = null) : \Zend_Form_ElementAdd prefix path for plugin loader for captcha adapters
This method handles the captcha type, the rest is handled by
the parent
Parameters| Name | Type | Description |
|---|---|---|
| $prefix | string | |
| $path | string | |
| $type | string |
| Type | Description |
|---|---|
| \Zend_Form_Element |

getPluginLoader(string $type) : \Zend_Loader_PluginLoaderRetrieve plugin loader for validator or filter chain
Support for plugin loader for Captcha adapters
Parameters| Name | Type | Description |
|---|---|---|
| $type | string |
| Type | Description |
|---|---|
| \Zend_Loader_PluginLoader |
| Exception | Description |
|---|---|
| \Zend_Loader_Exception | on invalid type. |

isValid(mixed $value, mixed $context = null) : booleanIs the captcha valid?
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $value | mixed | |
| $context | mixed |
| Type | Description |
|---|---|
| boolean |

loadDefaultDecorators() : \Zend_Form_Element_CaptchaLoad default decorators
Returns
| Type | Description |
|---|---|
| \Zend_Form_Element_Captcha |

render(\Zend_View_Interface $view = null) : stringRender form element
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $view | \Zend_View_Interface |
| Type | Description |
|---|---|
| string |

setCaptcha(string | array | \Zend_Captcha_Adapter $captcha, array $options = array()) : voidSet captcha adapter
Parameters
| Name | Type | Description |
|---|---|---|
| $captcha | string | array | \Zend_Captcha_Adapter | |
| $options | array |

setOptions(array $options) : \Zend_Form_Element_CaptchaSet options
Overrides to allow passing captcha options
Parameters| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| \Zend_Form_Element_Captcha |