当前位置: 首页>>代码示例>>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;未经允许,请勿转载。