-
-
Notifications
You must be signed in to change notification settings - Fork 151
Closed
Milestone
Description
- bug report? no
- feature request? yes
- version: 3.0.0
Description
Currently value of hidden field is always casted to string, even if value is null. I would like to propose to allow null value or cast value to integer/float etc if there are defined validation rules.
forms/src/Forms/Controls/HiddenField.php:
public function setValue($value)
{
if (!is_scalar($value) && $value !== NULL && !method_exists($value, '__toString')) {
throw new Nette\InvalidArgumentException(sprintf("Value must be scalar or NULL, %s given in field '%s'.", gettype($value), $this->name));
}
if (!$this->persistValue) {
$this->value = (string) $value;
}
return $this;
}
Metadata
Metadata
Assignees
Labels
No labels