We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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)?



12.2k
Accepted
answer

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


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