当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form_Element_Submit::setAttrib方法代码示例

本文整理汇总了PHP中Zend_Form_Element_Submit::setAttrib方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Submit::setAttrib方法的具体用法?PHP Zend_Form_Element_Submit::setAttrib怎么用?PHP Zend_Form_Element_Submit::setAttrib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Form_Element_Submit的用法示例。


在下文中一共展示了Zend_Form_Element_Submit::setAttrib方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     $this->setName('add_new_post');
     $this->setMethod('Post');
     $this->setAttrib('encrypt', 'multipart/form-data');
     $heading = new Zend_Form_Element_Text('heading', array('disableLoadDefaultDecorators' => true));
     $heading->setRequired(true)->setLabel('* Blog Post Title:')->setAttrib('id', 'heading')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $url = new Zend_Form_Element_Text('url');
     $url->setRequired(true)->setAttrib('id', 'url')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control set-txt")->removeDecorator('htmlTag');
     $description = new Zend_Form_Element_Textarea('description', array('disableLoadDefaultDecorators' => true));
     $description->setRequired(true)->setLabel('* Description:')->setAttrib('id', 'description')->setAttrib('contenteditable', 'true')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     /*$categories = new Zend_Form_Element_Text('categories',array('disableLoadDefaultDecorators' =>true));
     		$categories->setLabel(' Category:')
     			->setAttrib('id', 'categories')
     			->addFilter('StripTags')
     			->addFilter('StringTrim')
     			->addValidator('NotEmpty')
     			->setAttrib("class", "form-control")
     			->removeDecorator('htmlTag');*/
     $is_comment = new Zend_Form_Element_Checkbox('is_comment', array('disableLoadDefaultDecorators' => true));
     $is_comment->setAttrib("id", "is_comment")->setLabel('Mark as No Comments:')->setAttrib("class", "form-control")->addFilter('StripTags')->addFilter('StringTrim');
     $tags = new Zend_Form_Element_Text('tags', array('disableLoadDefaultDecorators' => true));
     $tags->setLabel('Tags:')->setAttrib('id', 'tags')->setAttrib('placeholder', 'Separate tags with comma,')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $image = new Zend_Form_Element_File('image');
     $image->addValidator('Count', false, 1)->addValidator('ImageSize', false, array('minwidth' => 700, 'maxwidth' => 1000, 'minheight' => 500))->addValidator('Size', false, 1000240000)->setErrorMessages(array("Upload an image:"))->addValidator('Extension', false, 'jpg,png,gif,jpeg,jpg');
     // only JPEG, PNG, and GIFs
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit-btn');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Publish");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('heading', 'is_comment', 'url', 'image', 'description', 'tags'));
     $this->addElements(array($heading, $url, $is_comment, $image, $description, $tags, $submit));
 }
开发者ID:aliinfotech,项目名称:netefct,代码行数:32,代码来源:PostForm.php

示例2: init

 public function init()
 {
     $this->setName('social_link');
     //$this->setAction('socialMedia');
     $this->setMethod('Post');
     $facebook = new Zend_Form_Element_Text('facebook', array('disableLoadDefaultDecorators' => true));
     $facebook->setLabel(' Facebook:')->setAttrib('id', 'facebook')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $twitter = new Zend_Form_Element_Text('twitter', array('disableLoadDefaultDecorators' => true));
     $twitter->setLabel(' Twitter:')->setAttrib('id', 'twitter')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $youtube = new Zend_Form_Element_Text('youtube', array('disableLoadDefaultDecorators' => true));
     $youtube->setLabel(' Youtube:')->setAttrib('id', 'youtube')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $instagram = new Zend_Form_Element_Text('instagram', array('disableLoadDefaultDecorators' => true));
     $instagram->setLabel(' Instagram:')->setAttrib('id', 'instagram')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $tumblr = new Zend_Form_Element_Text('tumblr', array('disableLoadDefaultDecorators' => true));
     $tumblr->setLabel(' Tumblr:')->setAttrib('id', 'tumblr')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $google_plus = new Zend_Form_Element_Text('google_plus', array('disableLoadDefaultDecorators' => true));
     $google_plus->setLabel(' Google Plus:')->setAttrib('id', 'google_plus')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $linkedin = new Zend_Form_Element_Text('linkedin', array('disableLoadDefaultDecorators' => true));
     $linkedin->setLabel(' LinkedIn:')->setAttrib('id', 'linkedIn')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $pinterest = new Zend_Form_Element_Text('pinterest', array('disableLoadDefaultDecorators' => true));
     $pinterest->setLabel(' Pinterest:')->setAttrib('id', 'pinterest')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $dailymotion = new Zend_Form_Element_Text('dailymotion', array('disableLoadDefaultDecorators' => true));
     $dailymotion->setLabel(' Dailymotion:')->setAttrib('id', 'dailymotion')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $vimeo = new Zend_Form_Element_Text('vimeo', array('disableLoadDefaultDecorators' => true));
     $vimeo->setLabel(' Vimeo:')->setAttrib('id', 'vimeo')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Update");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('twitter', 'vimeo', 'dailytmotion', 'pinterest', 'facebook', 'tumblr', 'google_plus', 'youtube', 'linkedin', 'instagram'));
     ///$this->addElement('hash', 'csrf', array('ignore' => true,));
     $this->addElements(array($twitter, $vimeo, $dailymotion, $pinterest, $google_plus, $tumblr, $facebook, $youtube, $instagram, $linkedin, $submit));
 }
开发者ID:aliinfotech,项目名称:netefct,代码行数:32,代码来源:SocialLinkForm.php

示例3: init

 public function init()
 {
     $this->setName('param');
     $this->setAttrib('class', 'form-inline');
     $host1 = new Zend_Form_Element_Text('host1');
     $host1->setAttrib('class', 'form-control')->setLabel('host1')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Hostname');
     $host1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row form-inline', 'openOnly' => true))));
     $user1 = new Zend_Form_Element_Text('user1');
     $user1->setLabel('user1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('EmailAddress');
     $user1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4'))));
     $password1 = new Zend_Form_Element_Text('password1');
     $password1->setLabel('pass1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $password1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'closeOnly' => 'true'))));
     $host2 = new Zend_Form_Element_Text('host2');
     $host2->setAttrib('class', 'form-control')->setLabel('host2')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Hostname');
     $host2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'row', 'openOnly' => true))));
     $user2 = new Zend_Form_Element_Text('user2');
     $user2->setLabel('user2')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('EmailAddress');
     $user2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4'))));
     $password2 = new Zend_Form_Element_Text('password2');
     $password2->setLabel('pass2')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $password2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'closeOnly' => 'true'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit');
     $submit->setAttrib('class', 'btn btn-default');
     $submit->setAttrib('value', 'transfer_source');
     $submit->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'col-md-4 col-md-offset-4 text-center'))));
     $this->addElements(array($host1, $user1, $password1, $host2, $user2, $password2, $submit));
     $this->setDecorators(array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-inline')), 'Form'));
 }
开发者ID:graniasty,项目名称:imap_zend,代码行数:30,代码来源:Paramtest.php

示例4: init

 public function init()
 {
     $this->setName('add_testimonial');
     //$this->setAction('newExpert');
     $this->setMethod('Post');
     $this->setAttrib('enctype', 'multipart/form-data');
     $first_name = new Zend_Form_Element_Text('first_name', array('disableLoadDefaultDecorators' => true));
     $first_name->setRequired(true)->setLabel('* First Name:')->setAttrib('id', 'video_title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $last_name = new Zend_Form_Element_Text('last_name', array('disableLoadDefaultDecorators' => true));
     $last_name->setRequired(true)->setLabel('* Last Name:')->setAttrib('id', 'url_video')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $email = new Zend_Form_Element_Text('email', array('disableLoadDefaultDecorators' => true));
     $email->setRequired(true)->setLabel('* Email:')->setAttrib('id', 'email')->setAttrib('size', '30')->addFilter('StripTags')->addFilter('StringTrim')->setErrorMessages(array("Write Email"))->addValidator('EmailAddress', true)->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $short_description = new Zend_Form_Element_Textarea('short_description', array('disableLoadDefaultDecorators' => true));
     $short_description->setRequired(true)->setAttrib("id", "short_description")->setLabel(' *Testimonial:')->setAttrib("class", "form-control")->setAttrib('ROWS', '5')->setAttrib('COLS', '3')->setErrorMessages(array("Write Description for Testimonial"))->addFilter('StringTrim');
     $image1 = new Zend_Form_Element_File('image1');
     //$image1->setRequired(true)
     $image1->addValidator('Count', false, 1)->addValidator('ImageSize', false, array('minwidth' => 100, 'maxwidth' => 400, 'minheight' => 100, 'maxheight' => 400))->addValidator('Size', false, 1000240000)->setErrorMessages(array("*Upload an image:"))->addValidator('Extension', false, 'jpg,png,gif');
     // only JPEG, PNG, and GIFs
     $is_featured = new Zend_Form_Element_Checkbox('is_featured', array('disableLoadDefaultDecorators' => true));
     $is_featured->setAttrib("id", "is_featured")->setLabel('Featured:')->setAttrib("class", "form-control")->addFilter('StripTags')->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('first_name', 'last_name', 'email', 'short_description', 'image1', 'is_featured'));
     //$this->addElement('hash', 'csrf', array('ignore' => true,));
     $this->addElements(array($first_name, $last_name, $image1, $email, $is_featured, $short_description, $submit));
 }
开发者ID:habbash18,项目名称:netefct,代码行数:27,代码来源:AddTestimonialForm.php

示例5: init

 public function init()
 {
     $this->setName('transfer_source');
     $this->setAttrib('class', 'form-inline');
     $host1 = new Zend_Form_Element_Text('host1');
     $host1->setAttrib('class', 'form-control')->setLabel('host1')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('Hostname');
     $edit = new Zend_Form_Element_Hidden('edit');
     //$edit->setLabel('Edition Mode');
     //$edit->clearDecorators();
     $host1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
     $user1 = new Zend_Form_Element_Text('user1');
     $user1->setLabel('user1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator('EmailAddress');
     $user1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
     $password1 = new Zend_Form_Element_Text('password1');
     $password1->setLabel('pass1')->setAttrib('class', 'form-control')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $password1->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
     $action = new Zend_Form_Element_Select('action');
     $action->setOptions(array('1' => 'source', '2' => 'target'));
     $action->setAttrib('class', 'form-control');
     $action->options = array('1' => 'source', '2' => 'target');
     $action->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-2'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit');
     $submit->setAttrib('class', 'btn btn-default');
     $submit->setAttrib('value', 'transfer_source');
     $submit->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'colspan' => 2, 'align' => 'center')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $this->addElements(array($edit, $host1, $user1, $password1, $action, $submit));
     $this->setDecorators(array('FormElements', 'Form'));
 }
开发者ID:graniasty,项目名称:imap_zend,代码行数:29,代码来源:AddToTransfer_u.php

示例6: __construct

 public function __construct()
 {
     $transactionType = new Zend_Form_Element_Select('transactionType');
     $transactionType->setAttrib('class', 'NormalBtn');
     $transactionType->setRequired(true)->addValidators(array(array('NotEmpty')));
     $transactionMode = new Zend_Form_Element_Select('transactionMode');
     $transactionMode->setAttrib('class', 'NormalBtn');
     $transactionMode->setRequired(true);
     //                                 ->addValidators(array(array('NotEmpty')));
     $transactionMode->setAttrib('onchange', 'display(this.value);');
     $transaction_interest_amount = new Zend_Form_Element_Text('transaction_interest_amount');
     $transaction_interest_amount->setAttrib('class', 'NormalBtn');
     $transaction_fine_amount = new Zend_Form_Element_Text('transaction_fine_amount');
     $transaction_fine_amount->setAttrib('class', 'NormalBtn');
     $account_id = new Zend_Form_Element_Text('account_id');
     $account_id->setAttrib('class', 'NormalBtn');
     $transaction_date = new Zend_Form_Element_Text('transaction_date');
     $transaction_date->setAttrib('class', 'NormalBtn');
     $transaction_date->setRequired(true)->addValidators(array(array('NotEmpty')));
     $transaction_date->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     $transaction_amount = new Zend_Form_Element_Text('transaction_amount');
     $transaction_amount->setAttrib('class', 'NormalBtn');
     $transaction_remarks = new Zend_Form_Element_Textarea('transaction_remarks', array('rows' => 3, 'cols' => 15));
     $transaction_remarks->setAttrib('class', 'NormalBtn');
     $transaction_remarks->setRequired(true)->addValidators(array(array('NotEmpty')));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit');
     $submit->setAttrib('class', 'NormalBtn');
     $submit->setLabel('submit');
     $this->addElements(array($transactionType, $transactionMode, $transaction_interest_amount, $transaction_fine_amount, $account_id, $transaction_date, $transaction_amount, $transaction_remarks, $submit));
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:31,代码来源:Altertransaction.php

示例7: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAction('/main/new');
     $this->setAttrib('id', 'newRoute');
     $note = new Zend_Form_Element_Note('title', array('value' => '<h2 id="titleProductDetails">Create a New Route</h2>'));
     $intermed = new Zend_Form_Element_Hidden('intermed');
     $intermed->setAttrib('readonly', 'readonly');
     $intermed->addFilter('StripTags');
     $intermed->addFilter('HtmlEntities');
     $intermed->addFilter('StringTrim');
     $start = new Zend_Form_Element_Text('startForm');
     $start->setLabel('Starting Point*');
     $start->setAttrib('autocomplete', 'off');
     $start->addFilter('StripTags');
     $start->addFilter('HtmlEntities');
     $start->setAttrib('class', 'form-control');
     $start->addFilter('StringTrim');
     $start->setRequired(true)->addErrorMessage('Start Location Required');
     //        $start->addValidator('Regex', true, array('/^[a-zA-Z0-9.,:-\s]*$/'))->addErrorMessage('Invalid characters used');
     //        $start->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $end = new Zend_Form_Element_Text('endForm');
     $end->setLabel('Destination*');
     $end->setAttrib('autocomplete', 'off');
     $end->addFilter('StripTags');
     $end->setAttrib('class', 'form-control');
     $end->addFilter('HtmlEntities');
     $end->addFilter('StringTrim');
     $end->setRequired(true)->addErrorMessage('Destination Required');
     //        $end->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $routeDate = new Zend_Form_Element_Text('routeDate');
     $routeDate->setAttrib('autocomplete', 'off');
     $routeDate->setAttrib('readonly', 'readonly');
     $routeDate->setAttrib('maxlength', '10');
     $routeDate->setAttrib('class', 'form-control');
     $routeDate->setLabel('Date of Journey' . '*');
     $routeDate->addFilter('StripTags');
     $routeDate->addFilter('HtmlEntities');
     $routeDate->addFilter('StringTrim');
     $routeDate->setRequired(true)->addErrorMessage('Date Required');
     $routeDate->addValidator('Regex', true, array('/^[0-9.\\s]*$/'))->addErrorMessage('Invalid characters used');
     $routeDate->addValidator('StringLength', true, array(10, 10))->addErrorMessage('Required Field');
     $passangers = new Zend_Form_Element_Select('passangers');
     $passangers->setLabel('No of Passangers*');
     $passangers->setAttrib('autocomplete', 'off');
     $passangers->setAttrib('class', 'form-control');
     $passangers->addFilter('StripTags');
     $passangers->addFilter('HtmlEntities');
     $passangers->addFilter('StringTrim');
     $passangers->setRequired(true)->addErrorMessage('Password Required');
     $passangers->setMultiOptions(array('1' => '1 Passanger', '2' => '2 Passangers', '3' => '3 Passangers', '4' => '4 Passangers', '5' => '5 Passangers', '6' => '6 Passangers'));
     $submit = new Zend_Form_Element_Submit('newRoute');
     $submit->setLabel('New Route');
     $submit->setAttrib('class', 'btn btn-info');
     $submit->setAttrib('style', 'margin-top:20px');
     $this->addElements(array($note, $intermed, $start, $end, $passangers, $routeDate, $submit));
     $this->setElementDecorators(array('ViewHelper', 'Label', 'Errors'));
     $submit->setDecorators(array('ViewHelper'));
     $this->setDecorators(array('FormElements', 'Form', array('HtmlTag', array('tag' => 'div', 'id' => 'newRouteFormContainer'))));
 }
开发者ID:bogdanmatra,项目名称:ibm-hackathon,代码行数:60,代码来源:Route.php

示例8: init

 public function init()
 {
     $this->setName('add_video_link');
     //$this->setAction('newExpert');
     $this->setMethod('Post');
     $this->setAttrib('enctype', 'multipart/form-data');
     $title = new Zend_Form_Element_Text('title', array('disableLoadDefaultDecorators' => true));
     $title->setRequired(true)->setLabel('* Video Title:')->setAttrib('id', 'video_title')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $url_video = new Zend_Form_Element_Text('url_video', array('disableLoadDefaultDecorators' => true));
     $url_video->setRequired(true)->setLabel('* Video URL:')->setAttrib('id', 'url_video')->addValidator('NotEmpty')->setAttrib("class", "form-control")->addFilter('StripTags')->addFilter('StringTrim')->removeDecorator('htmlTag');
     $short_description = new Zend_Form_Element_Textarea('short_description', array('disableLoadDefaultDecorators' => true));
     $short_description->setRequired(true)->setAttrib("id", "short_description")->setLabel(' *Short Description:')->setAttrib("class", "form-control")->setAttrib('ROWS', '5')->setAttrib('COLS', '3')->addFilter('StringTrim');
     $video_img = new Zend_Form_Element_File('video_img');
     //$video_img->setRequired(true)
     $video_img->addValidator('Count', false, 1)->addValidator('ImageSize', false, array('minwidth' => 100, 'maxwidth' => 1000, 'minheight' => 100, 'maxheight' => 1000))->addValidator('Size', false, 1000240000)->setErrorMessages(array("Upload an image:"))->addValidator('Extension', false, 'jpg,png,gif,jpeg');
     // only JPEG, PNG, and GIFs
     $is_featured = new Zend_Form_Element_Checkbox('is_featured', array('disableLoadDefaultDecorators' => true));
     $is_featured->setAttrib("id", "is_featured")->setLabel('Featured:')->setAttrib("class", "form-control")->addFilter('StripTags')->addFilter('StringTrim');
     $is_main = new Zend_Form_Element_Checkbox('is_main', array('disableLoadDefaultDecorators' => true));
     $is_main->setAttrib("id", "is_main")->setLabel('Mark main video:')->setAttrib("class", "form-control")->addFilter('StripTags')->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit-btn');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('title', 'short_description', 'url_video', 'video_img', 'is_featured', 'is_main'));
     //$this->addElement('hash', 'csrf', array('ignore' => true,));
     $this->addElements(array($title, $short_description, $video_img, $url_video, $is_featured, $is_main, $submit));
 }
开发者ID:habbash18,项目名称:netefct,代码行数:27,代码来源:AddVideoLinkForm.php

示例9: init

 public function init()
 {
     $this->setName('photo_gallery');
     $photo_name = new Zend_Form_Element_File('photo_name');
     $photo_name->setRequired(true)->addValidator('Count', false, 1)->addValidator('FilesSize', false, array('min' => '1kB', 'max' => '5MB'))->addValidator('ImageSize', false, array('minwidth' => 10, 'minheight' => 10))->addFilter('StringTrim')->setErrorMessages(array("Upload an image"))->addValidator('Extension', false, 'jpeg,jpg,png,gif');
     // only JPEG, PNG, and GIFs
     $caption = new Zend_Form_Element_Text('caption', array('disableLoadDefaultDecorators' => true));
     $caption->setAttrib('id', 'caption')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $link = new Zend_Form_Element_Text('link', array('disableLoadDefaultDecorators' => true));
     $link->setAttrib('id', 'link')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $description = new Zend_Form_Element_Textarea('description', array('disableLoadDefaultDecorators' => true));
     $description->setAttrib('id', 'editor1')->setAttrib('name', 'description')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $category = new Zend_Form_Element_Select('category', array('disableLoadDefaultDecorators' => true));
     $category->setAttrib("id", "category")->setAttrib("class", "dropdown form-control")->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $data = new Application_Model_PGCategory();
     $results = $data->getAllCategoriesNames()->toArray();
     foreach ($results as $result) {
         $category->addMultiOption($result['pg_cat_id'], $value = $result['category_name']);
     }
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit-btn');
     $submit->setAttrib('class', 'btn btn-md btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('photo_name', 'category', 'caption', 'description', 'link'));
     $this->addElements(array($photo_name, $category, $caption, $description, $link, $submit));
 }
开发者ID:aliinfotech,项目名称:netefct,代码行数:25,代码来源:GalleryForm.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     // 	$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value
     // create instance to call common field
     $formfield = new App_Form_Field();
     // send parameters to get form fields (first parameter is a form field type)
     $offerproduct_id = $formfield->field('Hidden', 'offerproduct_id', '', '', '', 'offerproduct_id', false, '', '', '', '', '', '', '');
     $productshortname = $formfield->field('Text', 'productshortname', '', '', '', 'productshortname', false, '', '', '', '', '', '', '');
     $currentdates = $formfield->field('Hidden', 'currentdates', '', '', '', 'currentdates', false, '', '', '', '', '', '', '');
     $productType = $formfield->field('Select', 'productType', '', '', '', 'productType', false, '', '', '', '', '', '', '');
     $productType->setRegisterInArrayValidator(false);
     $productType->setAttrib('onchange', 'getSavingAccount(this.value)');
     $savingproducttype = $formfield->field('Text', 'savingproductname', '', '', '', 'savingproductname', false, '', '', '', '', '', '', '');
     $savingproducttype->setAttrib('readonly', 'true');
     $offerproductname = $formfield->field('Text', 'offerproductname', '', '', 'mand', 'offerproductname', true, '', '', '', '', '', '', '');
     $offerproductname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productsoffer', 'name'));
     $offerproductshortname = $formfield->field('Text', 'offerproductshortname', '', '', 'mand', 'offerproductshortname', true, '', '', '', '', '', '', '');
     $offerproductshortname->addValidators(array(array('NotEmpty'), array('stringLength', false, array(1, 3))));
     $offerproduct_description = $formfield->field('Textarea', 'offerproduct_description', '', '', 'mand', 'offerproduct_description', true, '', '', '', 2, 23, '', '');
     $begindate = $formfield->field('Text', 'begindate', '', '', '', 'begindate', false, '', '', '', '', '', 0, '');
     $begindate->setAttrib('class', 'd');
     $closedate = $formfield->field('Text', 'closedate', '', '', 'mand', 'closedate', true, '', '', '', '', '', '', '');
     $closedate->setAttrib('class', 'd');
     $closedate->addValidator(new Zend_Validate_Date('DD-MM-YYYY'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     //         $feeglcode = $formfield->field('Select','feeglcode','','','mand','feeglcode',true,'','','','','','','');
     $applicableto = $formfield->field('Select', 'applicableto', '', '', 'mand', 'applicableto', true, '', '', '', '', '', '', '');
     //         $glsubcode = $formfield->field('Select','glsubcode_id','','','mand','glsubcode_id',true,'','','','','','','');
     $minmumdeposit = $formfield->field('Text', 'minmumdeposit', '', '', 'mand', 'minmumdeposit', true, '', '', '', '', '', '', '');
     $graterthan = new Zend_Validate_GreaterThan(0);
     $minmumdeposit->setRequired(true)->addValidators(array(array('stringLength', false, array(1, 8))))->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true)));
     $frequencyofdeposit = $formfield->field('Select', 'frequencyofdeposit', '', '', 'mand', 'frequencyofdeposit', true, '', '', '', '', '', '', '');
     $Int_timefrequency_id = $formfield->field('Select', 'Int_timefrequency_id', '', '', 'mand', 'Int_timefrequency_id', true, '', '', '', '', '', '', '');
     $frequencyofinterestupdating = $formfield->field('Select', 'frequencyofinterestupdating', '', '', 'mand', 'frequencyofinterestupdating', true, '', '', '', '', '', '', '');
     $frequencyofinterestupdating->addMultiOption('MinBalance', 'MinBalance');
     $frequencyofinterestupdating->addMultiOption('AvgBalance', 'AvgBalance');
     $minimumbalanceforinterest = $formfield->field('Text', 'minimumbalanceforinterest', '', '', 'mand', 'minimumbalanceforinterest', true, '', '', '', '', '', '', '');
     $graterthan = new Zend_Validate_GreaterThan(0);
     $minimumbalanceforinterest->setRequired(true)->addValidators(array(array('stringLength', false, array(2, 8))))->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true)));
     $minimum_deposit_amount = $formfield->field('Text', 'minimum_deposit_amount', '', '', 'mand', 'minimum_deposit_amount', true, '', '', '', '', '', '', '');
     $graterthan = new Zend_Validate_GreaterThan(0);
     $minimum_deposit_amount->setRequired(true)->addValidators(array(array('stringLength', false, array(1, 10))))->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true)));
     $maximum_deposit_amount = $formfield->field('Text', 'maximum_deposit_amount', '', '', 'mand', 'maximum_deposit_amount', true, '', '', '', '', '', '', '');
     $graterthan = new Zend_Validate_GreaterThan(0);
     $maximum_deposit_amount->setRequired(true)->addValidators(array(array('stringLength', false, array(1, 10))))->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true)));
     $frequency_of_deposit = $formfield->field('Select', 'frequency_of_deposit', '', '', '', 'frequency_of_deposit', true, '', '', '', '', '', '', '');
     $penal_Interest = $formfield->field('Text', 'penal_Interest', '', '', 'mand', 'penal_Interest', true, '', '', '', '', '', '', '');
     $graterthan = new Zend_Validate_GreaterThan(0);
     $penal_Interest->setRequired(true)->addValidators(array(array('stringLength', false, array(1, 4))))->addValidators(array(array('NotEmpty'), array('Digits'), array($graterthan, true)));
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setAttrib('class', 'savings');
     $submit->setAttrib('id', 'savings');
     $this->addElements(array($productType, $offerproductname, $offerproductshortname, $offerproduct_description, $begindate, $closedate, $applicableto, $minmumdeposit, $frequencyofdeposit, $Int_timefrequency_id, $frequencyofinterestupdating, $minimumbalanceforinterest, $minimum_deposit_amount, $maximum_deposit_amount, $frequency_of_deposit, $penal_Interest, $savingproducttype, $submit, $offerproduct_id, $productshortname, $currentdates));
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:54,代码来源:Savings.php

示例11: init

 public function init()
 {
     $url_video = new Zend_Form_Element_Textarea('url_video', array('disableLoadDefaultDecorators' => true));
     $url_video->setRequired(true)->setLabel('* Video URL:')->addValidator('NotEmpty')->setAttrib("class", "form-control")->addFilter('StringTrim')->removeDecorator('htmlTag');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('title', 'short_description', 'video_img', 'is_featured'));
     //$this->addElement('hash', 'csrf', array('ignore' => true,));
     //				$this->addElements(array($title,$short_description,$video_img,$url_video,$is_featured,$submit));
     $this->addElements(array($url_video, $submit));
 }
开发者ID:habbash18,项目名称:netefct,代码行数:12,代码来源:VForm.php

示例12: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'emailsettings');
     $id = new Zend_Form_Element_Hidden("id");
     $id_val = Zend_Controller_Front::getInstance()->getRequest()->getParam('id', null);
     $username = new Zend_Form_Element_Text("username");
     $username->setLabel("User name");
     $username->setAttrib("class", "formDataElement");
     // $username->setRequired("true");
     $username->setAttrib('maxlength', '100');
     //$username->addValidator('NotEmpty', false, array('messages' => 'Please enter username.'));
     $tls = new Zend_Form_Element_Text("tls");
     $tls->setLabel("Secure Transport Layer");
     $tls->setAttrib("class", "formDataElement");
     // $tls->setRequired("true");
     $tls->setAttrib('maxlength', '40');
     //  $tls->addValidator('NotEmpty', false, array('messages' => 'Please enter secure transport layer.'));
     $auth = new Zend_Form_Element_Select("auth");
     $auth->setLabel("Authentication Type");
     $auth->setMultiOptions(array('true' => 'True', 'false' => 'False'));
     $auth->setAttrib("class", "formDataElement");
     $auth->setAttrib("onChange", "toggleAuth()");
     $auth->setRequired("true");
     $auth->setAttrib('maxlength', '50');
     $auth->addValidator('NotEmpty', false, array('messages' => 'Please enter authentication type.'));
     $port = new Zend_Form_Element_Text("port");
     $port->setLabel("Port");
     $port->setAttrib("class", "formDataElement");
     $port->setRequired("true");
     $port->setAttrib('maxlength', '50');
     $port->addValidator('NotEmpty', false, array('messages' => 'Please enter port.'));
     $password = new Zend_Form_Element_Text("password");
     $password->setLabel("Password");
     $password->setAttrib("class", "formDataElement");
     // $password->setRequired("true");
     $password->setAttrib('maxlength', '100');
     // $password->addValidator('NotEmpty', false, array('messages' => 'Please enter password.'));
     $server_name = new Zend_Form_Element_Text("server_name");
     $server_name->setLabel("SMTP Server");
     $server_name->setAttrib("class", "formDataElement");
     $server_name->setRequired("true");
     $server_name->setAttrib('maxlength', '100');
     $server_name->addValidator('NotEmpty', false, array('messages' => 'Please enter SMTP Server.'));
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setLabel("Save");
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib("class", "formSubmitButton");
     $this->addElements(array($id, $submit, $username, $tls, $auth, $port, $password, $server_name));
     $this->setElementDecorators(array('ViewHelper'));
 }
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:52,代码来源:Emailsettings.php

示例13: init

 public function init()
 {
     $this->setName('category');
     $this->setMethod('Post');
     $category = new Zend_Form_Element_Text('category', array('disableLoadDefaultDecorators' => true));
     $category->setRequired(true)->setLabel(' *Category Name:')->setAttrib('id', 'category')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib("class", "form-control")->removeDecorator('htmlTag');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-lg btn-primary float-right')->removeDecorator('HtmlTag')->removeDecorator('Label')->setLabel("Save");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('category'));
     ///$this->addElement('hash', 'csrf', array('ignore' => true,));
     $this->addElements(array($category, $submit));
 }
开发者ID:habbash18,项目名称:netefct,代码行数:13,代码来源:CategoryForm.php

示例14: init

 public function init()
 {
     $this->setMethod('post');
     $this->setName('recover-password');
     // Add an email element
     $email = new Zend_Form_Element_Text('email');
     $email->setRequired(true)->setAttrib('size', '30')->setLabel('* Your Email Address:')->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('class', 'email1')->setErrorMessages(array("Write your email"))->addValidator('EmailAddress', true)->setAttrib('class', 'form-control')->setAttrib('place-holder', 'Email Address as ID');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'btn btn-md btn-primary')->removeDecorator('Label')->setLabel("Recover Now");
     $this->setElementDecorators(array('Errors', 'ViewHelper', array('Description', array('tag' => 'td' + '&nbsp;&nbsp;')), array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))), array('email'));
     $this->addElements(array($email, $submit));
 }
开发者ID:habbash18,项目名称:netefct,代码行数:13,代码来源:RecoverPassForm.php

示例15: __construct

 public function __construct($haveToPay, $currentdate, $fromDate)
 {
     parent::__construct($haveToPay, $currentdate, $fromDate);
     $accountId = new Zend_Form_Element_Hidden('accountcode');
     $installment_status = new Zend_Form_Element_Hidden('installment_status');
     $memberId = new Zend_Form_Element_Hidden('membercode');
     $amount = new Zend_Form_Element_Text('amount');
     $amount->setRequired(true)->addValidators(array(array('Float'), array('GreaterThan', false, array($haveToPay - 0.0001, 'messages' => array('notGreaterThan' => 'Min=' . $haveToPay)))));
     $amount->setAttrib('class', 'txt_put');
     $amount->setAttrib('id', 'amount');
     $loanInterestAmountPaied = new Zend_Form_Element_Text('loanInterestAmountPaied');
     $loanInterestAmountPaied->setAttrib('class', 'textfieldreadonly');
     $loanInterestAmountPaied->setAttrib('readonly', 'true');
     $loanInterestAmountPaied->setAttrib('id', 'loanInterestAmountPaied');
     $loanRepaymentDate = new Zend_Form_Element_Text('loanRepaymentDate');
     $loanRepaymentDate->setAttrib('id', 'loanRepaymentDate');
     $loanRepaymentDate->setAttrib('size', '8');
     $loanRepaymentDate->setAttrib('class', 'txt_put');
     $loanRepaymentDate->setRequired(true)->addValidators(array(array('Date', true), array('Between', false, array($fromDate, $currentdate, 'messages' => array('notBetween' => 'date should be between ' . $fromDate . ' to (today date) ' . $currentdate)))));
     $transactionMode = new Zend_Form_Element_Select('transactionMode');
     $transactionMode->addMultiOption('', 'select');
     $transactionMode->setAttrib('class', 'selectbutton');
     $transactionMode->setAttrib('onchange', 'toggleField();');
     $transactionMode->setAttrib('id', 'paymenttype');
     $transactionMode->setRequired(true);
     $transactionModeDetails = new Zend_Form_Element_Textarea('paymenttype_details');
     $transactionModeDetails->setAttrib('class', 'txt_put');
     $transactionModeDetails->setAttrib('id', 'paymenttype_details');
     $transactionModeDetails->setAttrib('style', 'display:none');
     $transactionModeDetails->setAttrib('rows', '1');
     $transactionModeDetails->setAttrib('cols', '20');
     $transactionModeDetails->setRequired(true);
     $pay = new Zend_Form_Element_Submit('pay');
     $pay->setAttrib('class', 'officesubmit');
     $pay->setAttrib('onclick', 'getState(this.value)');
     $pay->setLabel('pay');
     $back = new Zend_Form_Element_Submit('back');
     $back->setAttrib('class', 'officesubmit');
     $confirm = new Zend_Form_Element_Submit('confirm');
     $confirm->setAttrib('class', 'officesubmit');
     $confirm->setAttrib('onclick', 'getState(this.value)');
     $confirm->setLabel('confirm');
     $categoryId = new Zend_Form_Element_Hidden('categoryId');
     $categoryId->setAttrib('class', 'txt_put');
     $amount1 = new Zend_Form_Element_Hidden('repayableamounts1');
     $loanRepaymentDate1 = new Zend_Form_Element_Hidden('loanRepaymentDate1');
     $transactionMode1 = new Zend_Form_Element_Hidden('transactionMode1');
     $paymenttype_details1 = new Zend_Form_Element_Hidden('paymenttype_details1');
     $fine1 = new Zend_Form_Element_Hidden('fine1');
     $this->addElements(array($accountId, $amount, $loanRepaymentDate, $pay, $memberId, $loanInterestAmountPaied, $transactionMode, $transactionModeDetails, $categoryId, $installment_status, $confirm, $amount1, $loanRepaymentDate1, $transactionMode1, $paymenttype_details1, $fine1, $back));
 }
开发者ID:maniargaurav,项目名称:OurBank,代码行数:51,代码来源:Loanrepayment.php


注:本文中的Zend_Form_Element_Submit::setAttrib方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。