Cakephp 3.6 sending deprecated message (Accessing data as a Property will be Removed in 4.0.0.)

Asked

Viewed 109 times

0

I have some code in Php using Cakephp 3.6 that keeps sending the following alert:

Deprecated (16384): Accessing `data` as a property will be removed in 4.0.0. Use request->getData() instead. - F:\php\frameworks\cakePhp\bookmarker\src\Controller\ContactController.php, line: 33 [CORE\src\Core\functions.php, line 305]

An example of code would be the below:

$this->request->data['email'] = $user_data['email'];

What happens is if you’re a get I can solve using getData('email') for example, but if it is a set I tried something really weird like this:

 $this->request->getData('email') = $user_data['email'];

tried as well:

$this->request->setData('email', $user_data['email']);

but it didn’t work.

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.