API Documentation

Zend/Form/Element/Captcha.php

Show: inherited
Table of Contents

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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Form  
Subpackage
Element  
Version
$Id: Captcha.php 24774 2012-05-07 22:13:37Z adamlundrigan $  

\Zend_Form_Element_Captcha

Package: Zend\Form\Element

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
\http://en.wikipedia.org/wiki/Captcha  
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constant  CAPTCHA = 'CAPTCHA'

Captcha plugin type constant

Properties

Propertyprotected\Zend_Captcha_Adapter  $_captcha= ''

Captcha adapter

Details
Type
\Zend_Captcha_Adapter

Methods

methodpublic__construct( string|array|\Zend_Config $spec,  $options = null ) : void

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
Name Type Description
$spec string|array|\Zend_Config
$options
methodpublicaddPrefixPath( string $prefix, string $path, string $type = null ) : \Zend_Form_Element

Add 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
Returns
Type Description
\Zend_Form_Element
Details
See
\Zend_Form_Element::addPrefixPath  
methodpublicgetAttribs( ) : array

Return all attributes

Returns
Type Description
array
methodpublicgetCaptcha( ) : \Zend_Captcha_Adapter

Get captcha adapter

Returns
Type Description
\Zend_Captcha_Adapter
methodpublicgetPluginLoader( string $type ) : \Zend_Loader_PluginLoader

Retrieve plugin loader for validator or filter chain

Support for plugin loader for Captcha adapters

Parameters
Name Type Description
$type string
Returns
Type Description
\Zend_Loader_PluginLoader
Throws
Exception Description
\Zend_Loader_Exception on invalid type.
methodpublicisValid( mixed $value, mixed $context = null ) : boolean

Is the captcha valid?

Parameters
Name Type Description
$value mixed
$context mixed
Returns
Type Description
boolean
methodpublicloadDefaultDecorators( ) : \Zend_Form_Element_Captcha

Load default decorators

Returns
Type Description
\Zend_Form_Element_Captcha
methodpublicrender( \Zend_View_Interface $view = null ) : string

Render form element

Parameters
Name Type Description
$view \Zend_View_Interface
Returns
Type Description
string
methodpublicsetCaptcha( string|array|\Zend_Captcha_Adapter $captcha, array $options = array() ) : void

Set captcha adapter

Parameters
Name Type Description
$captcha string|array|\Zend_Captcha_Adapter
$options array
methodpublicsetOptions( array $options ) : \Zend_Form_Element_Captcha

Set options

Overrides to allow passing captcha options

Parameters
Name Type Description
$options array
Returns
Type Description
\Zend_Form_Element_Captcha
Documentation was generated by DocBlox 0.15.1.