Skip to content
Advertisement

Tag: symfony4

delete or clear session in symfony 4.4

I am saving the current user s data in a session, I am using Symfony 4.4 I am getting and setting the data to the session variable this way is there any way to clear and delete the session after logging out I tried and deleting the session one by using remove and nothing happened Answer i randomly came across

How to pass variable name from controller to twig file in Symfony?

I need to display image at my twig file. I am passing filename information as below: In my twig file, when I put the filename directly it works. But, I am not sure how to pass filename from controller to twig html file. I already tried following lines: It didn’t worked. Can anybody please help. Answer Use concatenation for argument

Symfony Update data with a post request

I am currently trying to update a Person in a table. The Table looks the following: I want to be able to update the First-and Lastname and also the nin when I click on the Submit button. My twig file looks like this: And my controller is the following: Currently when I click update I just fill it what’s in

UserPasswordEncoderInterface Autowiring Not Working Symfony 4.4

I have a super basic API endpoint with a fresh install of symfony 4.4 and I’m getting the following error: Cannot autowire argument $passwordEncoder of “AppControllerAuthenticationController::authenticateAction()”: it references interface “SymfonyComponentSecurityCoreEncoderUserPasswordEncoderInterface” but no such service exists. My Controller: If I remove UserPasswordEncoderInterface $passwordEncoder I get a successful nothing (expected for now). My User Entity is nothing special, and extends UserInterface correctly.

Advertisement