SignupForm::init PHP 메소드

init() 공개 메소드

public init ( )
  public function init() {
    $username = $this->addElement('text', 'username', array(
        'filters'    => array('StringTrim', 'StringToLower'),
        'validators' => array(
            'Alnum',
            array('StringLength', false, array(3, 20)),
        ),
        'required'   => true,
        'label'      => 'Your username:',
    ));

    $signup = $this->addElement('submit', 'signup', array(
        'required' => false,
        'ignore'   => true,
        'label'    => 'Sign up',
    ));

    // We want to display a 'failed authentication' message if necessary;
    // we'll do that with the form 'description', so we need to add that
    // decorator.
    $this->setDecorators(array(
        'FormElements',
        array('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form')),
        array('Description', array('placement' => 'prepend')),
        'Form'
    ));
  }
SignupForm