__construct() public méthode

public __construct ( $label = NULL, $multiple = FALSE )
Exemple #1
0
 /**
  * @param string $label
  */
 public function __construct($label = NULL)
 {
     parent::__construct($label, FALSE);
     $this->addCondition(Form::FILLED)->addRule(Form::IMAGE)->endCondition();
     $this->monitor(IPresenter::class);
     $this->checkbox = new Checkbox();
 }
 public function __construct($label, $uploadPath)
 {
     parent::__construct($label, FALSE);
     if ($uploadPath) {
         $this->setUploadPath($uploadPath);
     }
     $this->checkbox = new UploadCheckbox();
     $this->monitor('Nette\\Application\\IPresenter');
 }
 /**
  * FileUploadControl constructor.
  * @param string $name Název inputu.
  * @param int $maxFiles Maximální počet souborů.
  * @param string $maxFileSize Maximální velikosti souboru.
  */
 public function __construct($name, $maxFiles, $maxFileSize = NULL)
 {
     parent::__construct($name);
     $this->maxFiles = $maxFiles;
     if (is_null($maxFileSize)) {
         $this->maxFileSize = $this->parseIniSize(ini_get("upload_max_filesize"));
         $this->fileSizeString = ini_get("upload_max_filesize") . "B";
     } else {
         $this->maxFileSize = $this->parseIniSize($maxFileSize);
         $this->fileSizeString = $maxFileSize . "B";
     }
     $this->controller = new Model\UploadController($this);
     $this->token = uniqid();
 }
 /**
  * Constructor
  * @param string $label Label
  */
 public function __construct($label = NULL, $maxSelectedFiles = 25)
 {
     // Monitorování
     $this->monitor('Nette\\Forms\\Form');
     //$this->monitor('Nette\Application\Presenter');
     parent::__construct($label);
     if (!self::$handleUploadsCalled) {
         throw new InvalidStateException("MultipleFileUpload::handleUpload() has not been called. Call `MultipleFileUpload::register();` from your bootstrap before you call Applicaton::run();");
     }
     $this->maxFiles = $maxSelectedFiles;
     $this->control = Html::el("div");
     // TODO: support for prototype
     $this->maxFileSize = self::parseIniSize(ini_get('upload_max_filesize'));
     $this->simUploadThreads = 5;
 }