Nette\Forms\Controls\HiddenField::setValue PHP Method

setValue() public method

Sets control's value.
public setValue ( $value ) : self
return self
    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;
    }