Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: f39e9ea8a8
Fetching contributors…

Cannot retrieve contributors at this time

102 lines (88 sloc) 2.636 kb
<?php
namespace ZfcUser\Form;
use Zend\Form\Form;
use Zend\Form\Element;
use ZfcBase\Form\ProvidesEventsForm;
class Base extends ProvidesEventsForm
{
public function __construct()
{
parent::__construct();
$this->add(array(
'name' => 'username',
'options' => array(
'label' => 'Username',
),
'attributes' => array(
'type' => 'text'
),
));
$this->add(array(
'name' => 'email',
'options' => array(
'label' => 'Email',
),
'attributes' => array(
'type' => 'text'
),
));
$this->add(array(
'name' => 'display_name',
'options' => array(
'label' => 'Display Name',
),
'attributes' => array(
'type' => 'text'
),
));
$this->add(array(
'name' => 'password',
'options' => array(
'label' => 'Password',
),
'attributes' => array(
'type' => 'password'
),
));
$this->add(array(
'name' => 'passwordVerify',
'options' => array(
'label' => 'Password Verify',
),
'attributes' => array(
'type' => 'password'
),
));
if ($this->getRegistrationOptions()->getUseRegistrationFormCaptcha()) {
$this->add(array(
'name' => 'captcha',
'type' => 'Zend\Form\Element\Captcha',
'options' => array(
'label' => 'Please type the following text',
),
'attributes' => array(
'captcha' => $this->getOptions()->getFormCaptchaOptions(),
),
));
}
$submitElement = new Element\Button('submit');
$submitElement
->setLabel('Submit')
->setAttributes(array(
'type' => 'submit',
));
$this->add($submitElement, array(
'priority' => -100,
));
$this->add(array(
'name' => 'userId',
'attributes' => array(
'type' => 'hidden'
),
));
// @TODO: Fix this... getValidator() is a protected method.
//$csrf = new Element\Csrf('csrf');
//$csrf->getValidator()->setTimeout($this->getRegistrationOptions()->getUserFormTimeout());
//$this->add($csrf);
}
}
Jump to Line
Something went wrong with that request. Please try again.