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

Function Phalcon\Tag::resetInput() is deprecated

Hello!

I'm getting this error:

Deprecated: Function Phalcon\Tag::resetInput() is deprecated in C:\xampp\htdocs\marcelo\app\controllers\GruposController.php on line 89

Here is my code:

/**
 * Creates a new Profile
 */
public function criarAction()
{
    if ($this->request->isPost()) {

        $profile = new Grupos([
            'nome' => $this->request->getPost('nome', 'striptags'),
            'ativo' => $this->request->getPost('ativo')
        ]);

        if (!$profile->save()) {
            $this->flash->error($profile->getMessages());
        } else {
            $this->flash->success("Profile was created successfully");
        }

        Tag::resetInput();
    }

    $this->view->form = new GruposForm(null);
}


32.2k
Accepted
answer

Hi @marcelo you can use $_POST = null; // or []

Good luck

This is deprecated because you shouldn't really clear/change $_POST for any reasons.