本文整理汇总了PHP中Zend_Dojo_Form_Element_TextBox::setRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Dojo_Form_Element_TextBox::setRequired方法的具体用法?PHP Zend_Dojo_Form_Element_TextBox::setRequired怎么用?PHP Zend_Dojo_Form_Element_TextBox::setRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Dojo_Form_Element_TextBox
的用法示例。
在下文中一共展示了Zend_Dojo_Form_Element_TextBox::setRequired方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
$router = new Shared_Controller_Router();
$this->setAction($router->assemble(array(), 'login'));
$this->setMethod('post');
// email
$email = new Zend_Dojo_Form_Element_TextBox('email');
$email->setLabel(__('Email'));
$email->setRequired(true);
$this->addElement($email);
// password
$password = new Zend_Dojo_Form_Element_PasswordTextBox('password');
$password->setLabel(__('Password'));
$password->setRequired(true);
$this->addElement($password);
// remember
$remember = new Zend_Dojo_Form_Element_CheckBox('remember');
$remember->setLabel(__('Remember me on this computer'));
$remember->setCheckedValue('yes');
$remember->setUncheckedValue('no');
$remember->setChecked(true);
$this->addElement($remember);
// submit
$submit = new Zend_Dojo_Form_Element_SubmitButton('submit');
$submit->setLabel(__('Submit'));
$this->addElement($submit);
}
示例2: __construct
public function __construct()
{
parent::__construct();
$router = new Shared_Controller_Router();
$this->setAction($router->assemble(array(), 'application-new'));
$this->setMethod('post');
// name
$name = new Zend_Dojo_Form_Element_TextBox('name');
$name->setLabel(__('Name'));
$name->setRequired(true);
$this->addElement($name);
// description
$description = new Zend_Dojo_Form_Element_Textarea('description');
$description->setLabel(__('Description'));
$description->setAttrib('rows', '5');
$description->setAttrib('cols', '60');
$this->addElement($description);
// url
$url = new Zend_Dojo_Form_Element_TextBox('url');
$url->setLabel(__('URL'));
$url->setRequired(true);
$this->addElement($url);
// privacy
$privacy = new Zend_Dojo_Form_Element_ComboBox('privacy');
$privacy->setLabel(__('Privacy'));
$privacy->setRequired(true);
$privacy->addMultiOptions(array('private' => __('Private: users cannot follow this application'), 'public' => __('Public: users can follow this application')));
$privacy->setValue('public');
$this->addElement($privacy);
// submit
$submit = new Zend_Dojo_Form_Element_SubmitButton('submit');
$submit->setLabel(__('Submit'));
$this->addElement($submit);
}
示例3: __construct
public function __construct($options = null)
{
Zend_Dojo::enableForm($this);
parent::__construct($options);
$product_id = new Zend_Dojo_Form_Element_ComboBox('product_id');
$product_id->addMultiOption('', 'Select...');
$product_id->setAttrib('class', 'txt_put');
$product_id->setRequired(true)->addValidators(array(array('NotEmpty')));
$offerproductname = new Zend_Dojo_Form_Element_ValidationTextBox('offerproductname');
$offerproductname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productsofferdetails', 'offerproductname'));
$offerproductname->setAttrib('class', 'txt_put');
$offerproductname->setRequired(true)->addValidators(array(array('NotEmpty')));
$offerproductshortname = new Zend_Dojo_Form_Element_ValidationTextBox('offerproductshortname');
$offerproductshortname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productsofferdetails', 'offerproductshortname'));
$offerproductshortname->setAttrib('class', 'txt_put');
$offerproductshortname->setRequired(true)->addValidators(array(array('NotEmpty')));
$offerproduct_description = new Zend_Dojo_Form_Element_SimpleTextarea('offerproduct_description', array('rows' => 3, 'cols' => 20));
$offerproduct_description->setAttrib('class', '');
$offerproduct_description->setRequired(true)->addValidators(array(array('NotEmpty')));
// $begindate = new Zend_Dojo_Form_Element_DateTextBox('begindate');
// $begindate->setLabel('Birthday');
$begindate = new ZendX_JQuery_Form_Element_DatePicker('begindate', array('label' => 'Date:'));
$begindate->setJQueryParam('dateFormat', 'yy-mm-dd');
$begindate->setAttrib('class', 'txt_put');
$begindate->setRequired(true)->addValidators(array(array('Date', true, array('messages' => array('dateNotYYYY-MM-DD' => 'Please enter in this format(YYYY-MM-DD)', 'dateInvalid' => "'%value%' is not a valid date Please enter in this format(YYYY-MM-DD)"))), array('Between', false, array($beginDate, $matureDate, 'messages' => array('notBetween' => 'date should be between ' . $beginDate . ' to (Closed date) ' . $matureDate)))));
$minmumloanamount = new Zend_Dojo_Form_Element_NumberSpinner('minmumloanamount', array('value' => '7', 'label' => 'NumberSpinner', 'smallDelta' => 5, 'largeDelta' => 25, 'defaultTimeout' => 500, 'timeoutChangeRate' => 100, 'min' => 9, 'max' => 1550, 'places' => 0, 'maxlength' => 20));
$minmumloanamount->setAttrib('class', 'txt_put');
$minmumloanamount->setRequired(true)->addValidators(array(array('NotEmpty')));
$closedate = new Zend_Dojo_Form_Element_TextBox('closedate');
$closedate->setAttrib('class', 'txt_put');
$closedate->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true)->addValidator(new Zend_Validate_GreaterThan($begindate));
$applicableto = new Zend_Dojo_Form_Element_ComboBox('applicableto');
$applicableto->addMultiOption('', 'Select...');
$applicableto->setAttrib('class', 'txt_put');
$applicableto->setRequired(true)->addValidators(array(array('NotEmpty')));
$maximunloanamount = new Zend_Dojo_Form_Element_NumberTextBox('maximunloanamount');
$maximunloanamount->setAttrib('class', 'txt_put');
$maximunloanamount->setRequired(true);
$validator = new Zend_Validate_Digits();
$maximunloanamount->addValidator($validator, true);
$minimumfrequency = new Zend_Dojo_Form_Element_NumberTextBox('minimumfrequency');
$minimumfrequency->setAttrib('class', 'txt_put');
$minimumfrequency->setRequired(true)->addValidators(array(array('NotEmpty')));
$maximumfrequency = new Zend_Dojo_Form_Element_NumberTextBox('maximumfrequency');
$maximumfrequency->setAttrib('class', 'txt_put');
$maximumfrequency->setRequired(true)->addValidators(array(array('NotEmpty')));
$graceperiodnumber = new Zend_Dojo_Form_Element_NumberTextBox('graceperiodnumber');
$graceperiodnumber->setAttrib('class', 'txt_put');
$graceperiodnumber->setRequired(true)->addValidators(array(array('NotEmpty')));
$submit = new Zend_Dojo_Form_Element_SubmitButton('Submit');
$this->addElements(array($offerproductname, $offerproductshortname, $offerproduct_description, $begindate, $closedate, $applicableto, $minmumloanamount, $maximunloanamount, $minimumfrequency, $maximumfrequency, $graceperiodnumber, $product_id, $submit));
}
示例4: __construct
public function __construct($options = null)
{
Zend_Dojo::enableForm($this);
parent::__construct($options);
$product_id = new Zend_Dojo_Form_Element_ComboBox('product_id');
$product_id->addMultiOption('', 'Select...');
$product_id->setAttrib('class', 'txt_put');
$product_id->setRequired(true)->addValidators(array(array('NotEmpty')));
$offerproductname = new Zend_Dojo_Form_Element_TextBox('offerproductname');
$offerproductname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productsofferdetails', 'offerproductname'));
$offerproductname->setAttrib('class', 'txt_put');
$offerproductname->setRequired(true)->addValidators(array(array('NotEmpty')));
$offerproductshortname = new Zend_Dojo_Form_Element_TextBox('offerproductshortname');
$offerproductshortname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productsofferdetails', 'offerproductshortname'));
$offerproductshortname->setAttrib('class', 'txt_put');
$offerproductshortname->setRequired(true)->addValidators(array(array('NotEmpty')));
$offerproduct_description = new Zend_Dojo_Form_Element_SimpleTextarea('offerproduct_description', array('rows' => 3, 'cols' => 20));
$offerproduct_description->setAttrib('class', '');
$offerproduct_description->setRequired(true)->addValidators(array(array('NotEmpty')));
$begindate = new Zend_Dojo_Form_Element_DateTextBox('begindate');
$begindate->setLabel('Birthday');
$minmumloanamount = new Zend_Dojo_Form_Element_NumberSpinner('minmumloanamount', array('value' => '7', 'label' => 'NumberSpinner', 'smallDelta' => 5, 'largeDelta' => 25, 'defaultTimeout' => 500, 'timeoutChangeRate' => 100, 'min' => 9, 'max' => 1550, 'places' => 0, 'maxlength' => 20));
$minmumloanamount->setAttrib('class', 'txt_put');
$minmumloanamount->setRequired(true)->addValidators(array(array('NotEmpty')));
$closedate = new Zend_Dojo_Form_Element_TextBox('closedate');
$closedate->setAttrib('class', 'txt_put');
$closedate->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true)->addValidator(new Zend_Validate_GreaterThan($begindate));
$applicableto = new Zend_Dojo_Form_Element_ComboBox('applicableto');
$applicableto->addMultiOption('', 'Select...');
$applicableto->setAttrib('class', 'txt_put');
$applicableto->setRequired(true)->addValidators(array(array('NotEmpty')));
$maximunloanamount = new Zend_Dojo_Form_Element_TextBox('maximunloanamount');
$maximunloanamount->setAttrib('class', 'txt_put');
$maximunloanamount->setRequired(true);
$validator = new Zend_Validate_Digits();
$maximunloanamount->addValidator($validator, true);
$minimumfrequency = new Zend_Dojo_Form_Element_TextBox('minimumfrequency');
$minimumfrequency->setAttrib('class', 'txt_put');
$minimumfrequency->setRequired(true)->addValidators(array(array('NotEmpty')));
$maximumfrequency = new Zend_Dojo_Form_Element_TextBox('maximumfrequency');
$maximumfrequency->setAttrib('class', 'txt_put');
$maximumfrequency->setRequired(true)->addValidators(array(array('NotEmpty')));
$graceperiodnumber = new Zend_Dojo_Form_Element_TextBox('graceperiodnumber');
$graceperiodnumber->setAttrib('class', 'txt_put');
$graceperiodnumber->setRequired(true)->addValidators(array(array('NotEmpty')));
$submit = new Zend_Dojo_Form_Element_SubmitButton('Submit');
$this->addElements(array($offerproductname, $offerproductshortname, $offerproduct_description, $begindate, $closedate, $applicableto, $minmumloanamount, $maximunloanamount, $minimumfrequency, $maximumfrequency, $graceperiodnumber, $product_id, $submit));
}
示例5: __construct
public function __construct()
{
parent::__construct();
$router = new Shared_Controller_Router();
$this->setAction($router->assemble(array(), 'register'));
$this->setMethod('post');
// email
$email = new Zend_Dojo_Form_Element_TextBox('email');
$email->setLabel(__('Email'));
$email->setRequired(true);
$this->addElement($email);
// password
$password = new Zend_Dojo_Form_Element_PasswordTextBox('password');
$password->setLabel(__('Password'));
$password->setRequired(true);
$this->addElement($password);
// submit
$submit = new Zend_Dojo_Form_Element_SubmitButton('submit');
$submit->setLabel(__('Submit'));
$this->addElement($submit);
}
示例6: __construct
public function __construct($applicationId)
{
parent::__construct();
$router = new Shared_Controller_Router();
$this->setAction($router->assemble(array(), 'template-new') . '?applicationid=' . $applicationId);
$this->setMethod('post');
// name
$name = new Zend_Dojo_Form_Element_TextBox('name');
$name->setLabel(__('Name'));
$name->setRequired(true);
$this->addElement($name);
// body
$body = new Zend_Dojo_Form_Element_Textarea('body');
$body->setLabel(__('Body'));
$body->setRequired(true);
$body->setAttrib('rows', '5');
$body->setAttrib('cols', '60');
$body->setDescription(__('HTML: You may only use the <a> tag.') . '<br />' . __('Tokens: Tokens should be %-delimeted, e.g. %post_url%.'));
$body->getDecorator('Description')->setEscape(false);
$this->addElement($body);
// privacy
$privacy = new Zend_Dojo_Form_Element_ComboBox('privacy');
$privacy->setLabel(__('Privacy'));
$privacy->setRequired(true);
$privacy->addMultiOptions(array('private' => __('Private: users can follow this these events'), 'public' => __('Public: users cannot follow these events')));
$privacy->setValue('public');
$this->addElement($privacy);
// web hooks
$webhooks = new Zend_Dojo_Form_Element_CheckBox('web_hooks');
$webhooks->setLabel(__('Allow web hooks'));
$webhooks->setRequired(true);
$webhooks->setChecked(true);
$webhooks->setCheckedValue('yes');
$webhooks->setUncheckedValue('no');
$this->addElement($webhooks);
// submit
$submit = new Zend_Dojo_Form_Element_SubmitButton('submit');
$submit->setLabel(__('Submit'));
$this->addElement($submit);
}