/** * Constructor... * * Sets the default boolean filter * * @param String The name of this form field * @param String|NULL $label The label that describes this input field */ public function __construct($name, $label = NULL) { parent::__construct($name, $label); $this->setFilter(new \r8\Filter\Boolean()); }
/** * Constructor... * * @param String $name The name of this form field * @param String|NULL $label The label that describes this input field * @param \r8\Validator\FileUpload $validator The validator to use * for checking the uploaded file. If left empty, a default * instance will be created * @param \r8\Input\Files $files The list of uploaded files to pull * this fields value from. If left empty, the File list from * the global Request will be used */ public function __construct($name, $label = null, \r8\Validator\FileUpload $validator = null, \r8\Input\Files $files = null) { parent::__construct($name, $label); $this->validator = $validator ?: new \r8\Validator\FileUpload(); $this->files = $files ?: \r8\Env::request()->getFiles(); }
/** * Constructor... * * Loads in the default validator * * @param String The name of this form field * @param String|NULL $label The label that describes this input field */ public function __construct($name, $label = NULL) { parent::__construct($name, $label); $this->setValidator(new \r8\Validator\MultiField($this)); }