Nette\Forms\Controls\UploadControl::__construct PHP Метод

__construct() публичный Метод

public __construct ( $label = NULL, $multiple = FALSE )
    public function __construct($label = NULL, $multiple = FALSE)
    {
        parent::__construct($label);
        $this->control->type = 'file';
        $this->control->multiple = (bool) $multiple;
        $this->setOption('type', 'file');
        $this->addCondition(Forms\Form::FILLED)->addRule([$this, 'isOk'], Forms\Validator::$messages[self::VALID]);
    }

Usage Example

Пример #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();
 }
All Usage Examples Of Nette\Forms\Controls\UploadControl::__construct