Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Does the analogue of $tag->clear() method without using Forms exist?

The Forms has the "clear" method to remove the content of the tag. But how can I do it without Forms?

$tag->clear();

// For example
$password = new Password('pass', [
    'minlength'   => 2,
    'placeholder' => 'password'
]);
$password->clear();

May be, can I do it using Validation or Template (Volt)?



5.9k
Accepted
answer

Maybe this could help (if I understand you correctly):

$this->tag->setDefault('password', null);