/** * Constructor * * Creates session namespace for CSRF token, and adds validator for CSRF * token. * * @param string|array|\Zend\Config\Config $spec * @param array|\Zend\Config\Config $options * @return void */ public function __construct($spec, $options = null) { parent::__construct($spec, $options); $this->setAllowEmpty(false) ->setRequired(true) ->initCsrfValidator(); }
/** * Constructor * * @param string|array|\Zend\Config\Config $spec Element name or configuration * @param string|array|\Zend\Config\Config $options Element value or configuration * @return void */ public function __construct($spec, $options = null) { if (is_string($spec) && (null !== $options && is_string($options))) { $options = array('label' => $options); } if (!isset($options['ignore'])) { $options['ignore'] = true; } parent::__construct($spec, $options); }
/** * Constructor * * $spec may be: * - string: name of element * - array: options with which to configure element * - Zend_Config: Zend_Config with options for configuring element * * @param string|array|\Zend\Config\Config $spec * @return void */ public function __construct($spec, $options = null) { parent::__construct($spec, $options); $this->setAllowEmpty(true)->setRequired(true)->setAutoInsertNotEmptyValidator(false)->addValidator($this->getCaptcha(), true); }