Modify request->data from controller


I need to modify the request->data from a controller to reflect adjustments in a form.

E.g. modifying a number a user has entered in the controller which should than be reflected in the corresponding input-field in the view.

In the past I ve modifed “$this->request->data” directly, but this is deprecated now (and I know this is a bad practice).

“patchEntity” doesn’t show up in the form :frowning: Can you give me a hint?


$data = $this->request->getData();
// old: 3, new: 5
$data['price'] = 5;

$this->request = $this->request->withParsedBody($data);

… patchEntity, save …

Thats it! Thanks for your help