本文整理汇总了PHP中Zend_Form_Element_Submit::setOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Submit::setOptions方法的具体用法?PHP Zend_Form_Element_Submit::setOptions怎么用?PHP Zend_Form_Element_Submit::setOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Submit
的用法示例。
在下文中一共展示了Zend_Form_Element_Submit::setOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
// init the parent
parent::init();
// set the form's method
$this->setMethod('post');
$id = new Zend_Form_Element_Hidden('id');
$id->setOptions(array('validators' => array(new Zend_Validate_Regex('/^\\d*$/'))));
$this->addElement($id);
$firstname = new Zend_Form_Element_Text('firstname');
$firstname->setOptions(array('label' => $this->t('First name'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($firstname);
$lastname = new Zend_Form_Element_Text('lastname');
$lastname->setOptions(array('label' => $this->t('Last name'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($lastname);
$checkEmailNotJunk = new Zend_Validate_Callback(array($this, 'emailNotJetable'));
$uniqueEmailValidator = new Zend_Validate_Db_NoRecordExists(array('table' => 'backoffice_users', 'field' => 'email'));
$email = new Zend_Form_Element_Text('email');
$email->setOptions(array('label' => $this->t('Email'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', $checkEmailNotJunk, $uniqueEmailValidator)));
$this->addElement($email);
$raisonsocial = new Zend_Form_Element_Text('raison sociale');
$raisonsocial->setOptions(array('label' => $this->t('Raison sociale'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($raisonsocial);
// $groupsInArrayValidator = new Zend_Validate_InArray(array_keys(array(1, 2, 3)));
// $groupsInArrayValidator->setMessage('Please select at least one group. If you are not sure about which group is better, select "member".');
$status = new Zend_Form_Element_Radio('status');
$status->setOptions(array('label' => $this->t('Status'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty'), 'multiOptions' => array('Gérant' => 'Gérant', 'Associé' => 'Associé', 'Freelance patenté' => 'Freelance patenté')));
$this->addElement($status);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => $this->t('Save user'), 'required' => true, 'order' => 100));
$this->addElement($submit);
}
示例2: init
/**
* Overrides init() in Zend_Form
*
* @access public
* @return void
*/
public function init()
{
// init the parent
parent::init();
// set the form's method
$this->setMethod('post');
$username = new Zend_Form_Element_Text('username');
$username->setOptions(array('label' => 'Username', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty'), 'readonly' => 'readonly'));
$this->addElement($username);
$email = new Zend_Form_Element_Text('email');
$email->setOptions(array('label' => 'Email address', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', 'EmailAddress')));
$this->addElement($email);
$firstname = new Zend_Form_Element_Text('firstname');
$firstname->setOptions(array('label' => 'First name', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($firstname);
$lastname = new Zend_Form_Element_Text('lastname');
$lastname->setOptions(array('label' => 'Last name', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($lastname);
$phoneNumber = new Zend_Form_Element_Text('phone_number');
$phoneNumber->setOptions(array('label' => 'Phone number', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($phoneNumber);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => 'Save profile', 'required' => true));
$this->addElement($submit);
}
示例3: init
public function init()
{
$nameProject = new Zend_Form_Element_Text('nameProject');
$nameProject->setLabel('nom Projet')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$dateBegin = new Zend_Form_Element_Text('dateBegin');
$dateBegin->setLabel('à partir de :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$dateEnd = new Zend_Form_Element_Text('dateEnd');
$dateEnd->setLabel('jusqu\'à le :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$budget = new Zend_Form_Element_Text('budget');
$budget->setLabel('Budget :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$localisation = new Zend_Form_Element_Select('localisation');
$localisation->setLabel('Localisation :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$cityModel = new City();
$selectReferenceForCity = $cityModel->select()->setIntegrityCheck(false)->from('city');
$localisation->addMultiOption(0, '-');
foreach ($cityModel->fetchAll($selectReferenceForCity) as $row) {
$localisation->addMultiOption($row->city_id, $row->city_description);
}
$domaine = new Zend_Form_Element_Select('domaine');
$domaine->setLabel('Domaine :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$reference = new ReferenceValue();
$selectReferenceForDomain = $reference->select()->setIntegrityCheck(false)->from('reference_values')->where('reference_values.reference_Id=5');
$domaine->addMultiOption(0, '-');
foreach ($reference->fetchAll($selectReferenceForDomain) as $row) {
$domaine->addMultiOption($row->value_id, $row->name);
}
$statut = new Zend_Form_Element_Select('statut');
$statut->setLabel('statut :')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$statut->addMultiOptions(array('1' => 'encours', '2' => 'valide', '3' => 'suspendu'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => $this->t('Filter'), 'required' => true));
$this->setCancelLink(false);
$this->addElements(array($nameProject, $dateBegin, $dateEnd, $budget, $localisation, $domaine, $statut, $submit));
}
示例4: getFormLogin
private function getFormLogin()
{
$form = new Zend_Form(array('disableLoadDefaultDecorators' => true));
$email = new Zend_Form_Element_Text('login', array('disableLoadDefaultDecorators' => true));
$email->addDecorator('ViewHelper');
$email->addDecorator('Errors');
$email->setRequired(true);
$email->setAttrib('class', 'form-control');
$email->setAttrib('placeholder', 'Login');
$email->setAttrib('required', 'required');
$email->setAttrib('autofocus', 'autofocus');
$password = new Zend_Form_Element_Password('password', array('disableLoadDefaultDecorators' => true));
$password->addDecorator('ViewHelper');
$password->addDecorator('Errors');
$password->setRequired(true);
$password->setAttrib('class', 'form-control');
$password->setAttrib('placeholder', 'Hasło');
$password->setAttrib('required', 'required');
$password->setAttrib('autofocus', 'autofocus');
$submit = new Zend_Form_Element_Submit('submit', array('disableLoadDefaultDecorators' => true));
$submit->setAttrib('class', 'btn btn-lg btn-primary btn-block');
$submit->setOptions(array('label' => 'Zaloguj'));
$submit->addDecorator('ViewHelper')->addDecorator('Errors');
$form->addElement($email)->addElement($password)->addElement($submit);
return $form;
}
示例5: init
public function init()
{
$this->setMethod('post');
$this->setAction(DOMAIN . 'index/editforgotpassword');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'forgotpassword');
$id = new Zend_Form_Element_Hidden('id');
$username = new Zend_Form_Element_Text('emailaddress');
$username->setAttrib('class', 'email-status');
$username->setLabel('Email Address:');
$username->setRequired(true);
$username->addFilter('StripTags');
$username->addFilter('StringTrim');
$username->addValidator('NotEmpty', false, array('messages' => 'Please enter email.'));
$username->addValidator('EmailAddress');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('SEND');
$url = "'default/index/editforgotpassword/format/json'";
$dialogMsg = "''";
$toggleDivId = "''";
$jsFunction = "''";
$submit->setOptions(array('onclick' => "saveDetails({$url},{$dialogMsg},{$toggleDivId},{$jsFunction});"));
$this->addElements(array($id, $username, $submit));
$this->setElementDecorators(array('ViewHelper'));
}
示例6: init
/**
* Overrides init() in Zend_Form
*
* @access public
* @return void
*/
public function init()
{
// init the parent
parent::init();
// set the form's method
$this->setMethod('post');
//source
//alias aliasNotLogged viewIdentifier viewTitle params isStatic
//metaKeywords metaDescription
$id = new Zend_Form_Element_Hidden('urlAliasId');
$id->setOptions(array('validators' => array(new Zend_Validate_Regex('/^\\d*$/'))));
$this->addElement($id);
$source = new Zend_Form_Element_Text('source');
$source->setOptions(array('label' => 'Source', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($source);
$alias = new Zend_Form_Element_Text('alias');
$alias->setOptions(array('label' => 'Alias', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($alias);
$params = new Zend_Form_Element_Text('params');
$params->setOptions(array('value' => '{"module":"frontend","controller":"__","action":"__"}', 'label' => 'Params', 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($params);
$isStatic = new Zend_Form_Element_Text('isStatic');
$isStatic->setOptions(array('label' => 'isStatic', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($isStatic);
$metaKeywords = new Zend_Form_Element_Text('metaKeywords');
$metaKeywords->setOptions(array('label' => 'metaKeywords', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($metaKeywords);
$metaDescription = new Zend_Form_Element_Text('metaDescription');
$metaDescription->setOptions(array('label' => 'metaDescription', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($metaDescription);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => $this->t('Save'), 'required' => true));
$this->addElement($submit);
}
示例7: init
/**
* Overrides init() in Zend_Form
*
* @access public
* @return void
*/
public function init()
{
// init the parent
parent::init();
// set the form's method
$this->setMethod('post');
$idMember = App_Utilities::getIdMember();
$member_id = new Zend_Form_Element_Hidden('member_id');
$member_id->addFilter('Int')->setValue($idMember);
$this->addElement($member_id);
$start_date = new Zend_Form_Element_Text('start_date');
$start_date->setOptions(array('label' => $this->t('Start date'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($start_date);
$end_date = new Zend_Form_Element_Text('end_date');
$end_date->setOptions(array('label' => $this->t('End Date'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($end_date);
$is_posted = new Zend_Form_Element_Checkbox('is_posted');
$this->addElement($is_posted);
$companyName = new Zend_Form_Element_Text('name');
$companyName->setOptions(array('label' => $this->t('Company'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($companyName);
$function = new Zend_Form_Element_Text('function');
$function->setOptions(array('label' => $this->t('function'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($function);
$mission = new Zend_Form_Element_Textarea('mission');
$mission->setOptions(array('label' => $this->t('mission'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($mission);
$city_name = new Zend_Form_Element_Text('city_name');
$city_name->setOptions(array('label' => $this->t('city'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($city_name);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => $this->t('Save'), 'required' => true));
$this->addElement($submit);
}
示例8: __construct
/**
*
* @param mixed $options
*
* @return void
*
*/
public function __construct($options = null)
{
parent::__construct($options = null);
$this->setAction('/default/wished-userbook/search-list')->setMethod('get');
$defaultValue = __("Nom, prénom, email...", "s1b");
// Email element
$searchTermElement = new \Zend_Form_Element_Text("wishedListSearchTerm");
$searchTermElement->class = "input-item";
$searchTermElement->setValue($defaultValue);
$searchTermElement->setAttrib("auto-restore", "");
$searchTermElement->addValidator("stringlength", false, array("min" => 3, "messages" => array(\Zend_Validate_StringLength::TOO_SHORT => __("'%value%' doit faire plus de %min% caractères de long", "s1b"))));
$this->removeAllDecorators($searchTermElement);
// Submit button element
$searchButtonElement = new \Zend_Form_Element_Submit("search");
$searchButtonElement->setOptions(array('label' => __("Rechercher", "s1b")));
$searchButtonElement->class = "button bt-red-m";
$this->removeAllDecorators($searchButtonElement);
// Email default label element
$defaultLabelHidden = new \Zend_Form_Element_Hidden("emailDefaultLabel");
$defaultLabelHidden->setValue($defaultValue);
$defaultLabelHidden->class = "default-value";
$this->removeAllDecorators($defaultLabelHidden);
$this->addElements(array($searchTermElement, $searchButtonElement, $defaultLabelHidden));
$this->removeDecorator("HtmlTag");
}
示例9: init
/**
* Overrides init() in Zend_Form
*
* @access public
* @return void
*/
public function init()
{
// init the parent
parent::init();
// set the form's method
$this->setMethod('post');
$user = Zend_Auth::getInstance()->getIdentity();
$oldPasswordValidator = new App_Validate_PasswordExists(array('table' => 'backoffice_users', 'field' => 'password', 'treatment' => 'BackofficeUser::hashPassword', 'userPkValue' => $user->id));
$complexityValidator = new Zend_Validate_Regex('/^(?=.*\\d)(?=.*[a-z|A-Z]).{7,}$/');
$complexityValidator->setMessage('The selected password does not meet the required complexity requirements');
$stringLengthValidator = new Zend_Validate_StringLength();
$stringLengthValidator->setMin(7);
$stringLengthValidator->setMessage('Your password must be at least 7 characters long');
$passwordHistoryValidator = new App_Validate_NoPasswordExists(array('table' => 'password_log', 'field' => 'password', 'treatment' => 'BackofficeUser::hashPassword', 'userPkField' => 'user_id', 'userPkValue' => $user->id));
$oldPassword = new Zend_Form_Element_Password('old_password');
$oldPassword->setOptions(array('label' => $this->t('Old password'), 'required' => TRUE, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', $oldPasswordValidator)));
$this->addElement($oldPassword);
$password = new Zend_Form_Element_Password('password');
$password->setOptions(array('label' => $this->t('New password'), 'required' => TRUE, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', $stringLengthValidator, $complexityValidator, $passwordHistoryValidator)));
$this->addElement($password);
$sameAsValidator = new App_Validate_SameAs($password);
$sameAsValidator->setMessage('The two passwords do not coincide.', App_Validate_SameAs::NOT_THE_SAME);
$retypeNewPassword = new Zend_Form_Element_Password('retype_new_password');
$retypeNewPassword->setOptions(array('label' => $this->t('Retype new password'), 'required' => TRUE, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', $sameAsValidator)));
$this->addElement($retypeNewPassword);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => $this->t('Save password'), 'required' => TRUE));
$this->addElement($submit);
}
示例10: init
/**
* Overrides init() in Zend_Form
*
* @access public
* @return void
*/
public function init()
{
// init the parent
parent::init();
// set the form's method
$this->setMethod('post');
$username = new Zend_Form_Element_Text('username');
// $this->t = Zend_Registry::get('Zend_Translate');
$username->setOptions(array('label' => $this->t('Username'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($username);
$password = new Zend_Form_Element_Password('password');
$password->setOptions(array('label' => $this->t('Password'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($password);
$authentification = new LoginAttempt();
if ($authentification->canAttemptToLogin() == FALSE) {
$captcha = new Zend_Form_Element_Captcha('captcha', array('label' => $this->t("no humain"), 'captcha' => array("captcha" => "Image", "wordLen" => 4, "font" => "font/tahoma.ttf", "height" => 100, "width" => 300, "fontSize" => 50, "imgDir" => "data/captchas", "imgUrl" => "data/captchas")));
$this->addElement($captcha);
}
$connexion = new Zend_Form_Element_Submit('Connexion');
$connexion->setOptions(array('label' => $this->t('Log In')));
$connexion->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'dd', 'openOnly' => true))));
$this->addElement($connexion);
$inscription = new Zend_Form_Element_Submit('inscription');
$inscription->setOptions(array('label' => $this->t('Sign Up')));
$inscription->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'dd', 'closeOnly' => true))));
$this->addElement($inscription);
$this->clearDecorators();
}
示例11: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'roles');
$id = new Zend_Form_Element_Hidden('id');
$rolename = new Zend_Form_Element_Text('rolename');
$rolename->setAttrib('maxLength', 50);
$rolename->setAttrib('title', 'Role name');
$rolename->addFilter(new Zend_Filter_StringTrim());
$rolename->setRequired(true);
$rolename->addValidator('NotEmpty', false, array('messages' => 'Please enter role name.'));
$rolename->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9 ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid role name.')));
$rolename->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_roles', 'field' => 'rolename', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive!=0')));
$rolename->getValidator('Db_NoRecordExists')->setMessage('Role name already exists.');
$rolename->addValidators(array(array('StringLength', false, array('min' => 3, 'max' => 50, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Role name must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Role name must contain at least %min% characters.')))));
$roletype = new Zend_Form_Element_Text('roletype');
$roletype->setRequired(true);
$roletype->setAttrib('maxLength', 25);
$roletype->setAttrib('title', 'Role type');
$roletype->addFilter(new Zend_Filter_StringTrim());
$roletype->addValidator('NotEmpty', false, array('messages' => 'Please enter role type.'));
$roletype->addValidator("regex", true, array('pattern' => '/^[a-zA-Z]+?$/', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.')));
$roletype->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_roles', 'field' => 'roletype', 'exclude' => 'id != "' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive != 0')));
$roletype->getValidator('Db_NoRecordExists')->setMessage('Role type already exists.');
$roletype->addValidators(array(array('StringLength', false, array('min' => 3, 'max' => 25, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Role type must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Role type must contain at least %min% characters.')))));
$roledescription = new Zend_Form_Element_Textarea('roledescription');
$roledescription->setAttrib('rows', 10);
$roledescription->setAttrib('cols', 50);
$roledescription->setAttrib('maxlength', '100');
$roledescription->setAttrib('title', 'Role description');
$levelid = new Zend_Form_Element_Hidden('levelid');
$levelid->addFilter(new Zend_Filter_StringTrim());
$levelid->setRequired(true);
$levelid->addValidator('NotEmpty', false, array('messages' => 'Please select level.'));
$istimeActive = Zend_Controller_Front::getInstance()->getRequest()->getParam('istimeactive');
$prev_cnt = new Zend_Form_Element_Hidden('prev_cnt');
$prev_cnt->setRequired(true);
if ($istimeActive) {
$prev_cnt->addValidator('NotEmpty', false, array('messages' => 'Please select privileges other than time management.'));
} else {
$prev_cnt->addValidator('NotEmpty', false, array('messages' => 'Please select privileges.'));
}
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$url = "'roles/saveupdate/format/json'";
$dialogMsg = "''";
$toggleDivId = "''";
$jsFunction = "'redirecttocontroller(\\'roles\\');'";
$submit->setOptions(array('onclick' => "saveDetails({$url},{$dialogMsg},{$toggleDivId},{$jsFunction});"));
$this->addElements(array($id, $rolename, $roletype, $roledescription, $levelid, $submit, $prev_cnt));
$this->setElementDecorators(array('ViewHelper'));
}
示例12: init
public function init()
{
// if (!$this->hasTranslator()) {
// $this->setTranslator(Zend_Registry::get('Zend_Translate'));
// }
$username = new Zend_Form_Element_Text('username');
$username->setOptions(array('label' => 'Username', 'required' => TRUE, 'filters' => array('StringTrim')));
$password = new Zend_Form_Element_Password('password');
$password->setOptions(array('label' => 'Password', 'required' => TRUE));
$login = new Zend_Form_Element_Submit('login');
$login->setOptions(array('label' => 'Login'));
$this->setName('login-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($username, $password, $login))->setDecorators(array('FormElements', 'Errors', array('HtmlTag', array('tag' => 'table', 'cellpadding' => '3')), 'Form'));
}
示例13: init
/**
* Overrides init() in Zend_Form
*
* @access public
* @return void
*/
public function init()
{
// init the parent
parent::init();
// set the form's method
$this->setMethod('post');
$id = new Zend_Form_Element_Hidden('id');
$id->setOptions(array('required' => true, 'validators' => array(new Zend_Validate_Regex('/^\\d*$/'))));
$this->addElement($id);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => 'Yes, delete it', 'required' => true));
$this->addElement($submit);
}
示例14: init
/**
* Overrides init() in Zend_Form
*
* @access public
* @return void
*/
public function init()
{
// init the parent
parent::init();
// set the form's method
$this->setMethod('post');
// $username = new Zend_Form_Element_Text('username');
// $username->setOptions(
// array(
// 'label' => $this->t('Username'),
// 'required' => true,
// 'filters' => array(
// 'StringTrim',
// 'StripTags',
// ),
// 'validators' => array(
// 'NotEmpty',
// ),
// 'readonly' => 'readonly',
// )
// );
// $this->addElement($username);
$idMember = App_Utilities::getIdMember();
$member_id = new Zend_Form_Element_Hidden('member_id');
$member_id->addFilter('Int')->setValue($idMember);
$this->addElement($member_id);
$firstname = new Zend_Form_Element_Text('first_name');
$firstname->setOptions(array('label' => $this->t('First name'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($firstname);
$lastname = new Zend_Form_Element_Text('last_name');
$lastname->setOptions(array('label' => $this->t('Last name'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($lastname);
$email = new Zend_Form_Element_Text('email');
$email->setOptions(array('label' => $this->t('Email address'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', 'EmailAddress')));
$this->addElement($email);
$birthdate = new Zend_Form_Element_Text('birthdate');
$birthdate->setOptions(array('label' => $this->t('birthdate'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($birthdate);
$city = new Zend_Form_Element_Text('name');
$city->setOptions(array('label' => $this->t('city'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($city);
$phoneNumber = new Zend_Form_Element_Text('phone_number');
$phoneNumber->setOptions(array('label' => $this->t('Phone number'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($phoneNumber);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => $this->t('Save profile'), 'required' => true));
$this->addElement($submit);
}
示例15: init
/**
* Overrides init() in Zend_Form
*
* @access public
* @return void
*/
public function init()
{
// init the parent
parent::init();
// set the form's method
$this->setMethod('post');
$username = new Zend_Form_Element_Text('username');
$username->setOptions(array('label' => 'Username', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($username);
$password = new Zend_Form_Element_Password('password');
$password->setOptions(array('label' => 'Password', 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($password);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => 'Log in →', 'required' => true));
$this->addElement($submit);
}