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.

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);
}


24.1k
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.