westdc-zf1/application/models/UsereditForm.php

45 lines
1.8 KiB
PHP
Executable File

<?php
class UsereditForm extends Zend_Form
{
public function __construct($options = null)
{
parent::__construct($options);
$this->setName('UserEdit');
$oldpassword=new Zend_Form_Element_Password('oldpassword');
$oldpassword->setLabel('旧密码');
$password=new Zend_Form_Element_Password('password');
$password->setLabel('新密码')->addValidator('StringLength',false,array(6,20));
$password1=new Zend_Form_Element_Password('password1');
$password1->setLabel('确认新密码')
->addPrefixPath('Validator','validator/','validate')
->addValidator('Confirmation',false,array('password'));
$email=new Zend_Form_Element_Text('email');
$email->setLabel('E-Mail')
->addFilter('StringTrim')
->addValidator('NotEmpty')
->addValidator('EmailAddress');
$realname=new Zend_Form_Element_Text('realname');
$realname->setLabel('真实姓名')->setRequired(false);
$phone=new Zend_Form_Element_Text('phone');
$phone->setLabel('电话')->setRequired(false);
$unit=new Zend_Form_Element_Text('unit');
$unit->setLabel('单位')->setRequired(false);
$address=new Zend_Form_Element_Text('address');
$address->setLabel('联系地址')->setRequired(false);
$project=new Zend_Form_Element_Textarea('project');
$project->setLabel('隶属西部项目')->setRequired(false)->setAttrib('rows',4);
$id = new Zend_Form_Element_Hidden('id');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton')->setLabel('保存');
$this->addElements(array($id, $oldpassword,$password,$password1,$email,$realname,$phone,$unit,$address,$project,$submit));
}
}