當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Form::addMultipleFileUpload方法代碼示例

本文整理匯總了PHP中Nette\Application\UI\Form::addMultipleFileUpload方法的典型用法代碼示例。如果您正苦於以下問題:PHP Form::addMultipleFileUpload方法的具體用法?PHP Form::addMultipleFileUpload怎麽用?PHP Form::addMultipleFileUpload使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Nette\Application\UI\Form的用法示例。


在下文中一共展示了Form::addMultipleFileUpload方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createComponentForm

 public function createComponentForm($name)
 {
     $form = new Form($this, $name);
     $form->getElementPrototype()->class[] = "ajax";
     // activate AJAX in http://addons.nette.org/vojtech-dobes/nette-ajax-js
     $form->addText("textField", "Text field")->addRule(Form::FILLED, "This is required text field.");
     $form->addMultipleFileUpload("upload", "Attachments");
     //->addRule('MultipleFileUpload\MultipleFileUpload::validateFilled',"You have to upload at least one file!")
     //->addRule('MultipleFileUpload\MultipleFileUpload::validateFileSize',"Files are together too large.",100*1024);
     //$form->addMultipleFileUpload("upload2","Second file uploader");
     $form->addSubmit("send", "Submit your form!");
     $form->onSuccess[] = $this->handleFormSuccess;
     // Invalidace snippetů
     $form->onError[] = array($this, "handleRedrawForm");
     $form->onSuccess[] = array($this, "handleRedrawForm");
 }
開發者ID:jkuchar,項目名稱:multiplefileupload-example,代碼行數:16,代碼來源:HomepagePresenter.php

示例2: createComponentUploadPhotosForm

 /**
  * Form for uploading photos
  * Can only be created on the Generate action page and accessed
  * by somebody with generate privileges or higher
  *
  * @Privilege('generate')
  * @Action('generate')
  */
 protected function createComponentUploadPhotosForm()
 {
     $form = new Form();
     $form->addProtection('Vypršel časový limit, odešlete formulář znovu');
     $form->getElementPrototype()->class[] = "ajax";
     $form->addHidden('id');
     $form->addMultipleFileUpload("upload", "Fotky:")->addRule("MultipleFileUpload::validateFilled", "Musíte odeslat alespoň jeden soubor!")->addRule("MultipleFileUpload::validateFileSize", "Soubory jsou dohromady moc veliké!", 100 * 1024 * 1024);
     //100MiB
     if ($this->user->isAllowed('Admin:Default:Chronicle', 'show')) {
         $form->addCheckbox('showchronicle', 'Zobrazit kroniku')->setDefaultValue(TRUE);
     }
     $form->addSubmit("send", "Odeslat");
     $form->onSuccess[] = $this->uploadPhotosFormSucceded;
     // snippet invalidation
     $form->onError[] = $this->handleRedrawForm;
     $form->onSuccess[] = $this->handleRedrawForm;
     return $form;
 }
開發者ID:patrickkusebauch,項目名稱:27skauti,代碼行數:26,代碼來源:ChroniclePresenter.php


注:本文中的Nette\Application\UI\Form::addMultipleFileUpload方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。