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
Tag: symfony4
Doctrine 2 – MySql : multiples ‘BASE TABLE’ queries added to every views
Do you know why every views of my Symfony 4.4.25 website using Doctrine ORM 2.9.3 add between 3 and 10 queries like this: The database is MySQL version 5.7 Answer I had the same issue from a recent symfony 4.4 install, and fix it by removing the following parameter from doctrine_migrations.yaml:
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 TimeType set default value without duplicate value or overwrite
Im trying to make a user friendly timepicker. I use symfony 4.4 together with the form builder to create this timepicker. I use this timepicker when im creating my entity and editing my entity. Now I run into a small issue… I want the time to be at a specific “default” value. So I did the following. The ‘data’ object
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
Symfony 4: ROLE_USER doesn’t inherit IS_AUTHENTICATED_FULLY and Voter throws AccessDeniedException
I’m working on a legacy project with a lot of ancient staffs. There’re huge numbers of actions which are used really rare. Half a year ago we upgraded from Symfony 2.8 to Symfony 4.4. All worked …
Symfony – Doctrine filter date if end date is null
I have tricky one, I am trying for days to fix the issue. I have Reports and Subscriptions. I have specified one date for report.. (Report entity has reportDate filed) Idea is to return one result for that specific report day. Then in a query builder, I am triggering Subscriptions table that has startDate and endDate filed. Idea is to
pass id of foreign key to the form via post
I’ve created a new field (“responsavel”) on my db for this entity (“Multa”), “responsavel” is a foreign key to another table (Usuario) and I want it to be shown on my …
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.
Symfony 4 S3Client::factory issue: ‘class AwsS3S3Client not found’
I am trying getObject() from aws bucket, but when try s3Client, error: ‘class AwsS3S3Client not found’ Answer It seems like the aws skd isn’t installed. Try to install by command