Skip to content
Advertisement

Symfony4.4: PUT processing is redirected

I have updated from Symfony 3.x to Symfony 4.4.16 and verified the operation.
When I press “Registration/change” to save the form, I am redirected to the form input screen.
What I want to do is save the entered information in the DB and display the top screen and success message.
Are there any changes you made? When I tried php bin/console router:match /admin/initialSetting --method=PUT, it didn’t seem to be a problem.

Controller

JavaScript

services.yaml

JavaScript

initialSetting.html.twig

JavaScript

Postscript
Looking at the code in the browser’s development tools, I found that POST specified the method of the form.
Is there any lack of package updates?

JavaScript

Version
sensio/framework-extra-bundle v5.2.4
symfony/form v4.4.19

Advertisement

Answer

I changed it to the code below and solved the problem.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement