Skip to content
Advertisement

Tag: symfony

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

CollectionType elements missing data

I’ve embedded forms with CollectionType: and ‘battlePages’ is an ArrayCollection with many elements. But ‘$entity’ is empty however collection was walking through. My goal would be to get BattlePage entity’s data in the ‘BattlePageCollectionType’ which is my second in examples ($entity). Anybody had have similar issues? Answer The $builder->getData(); method doesn’t return an entity. You should use Form Events Example

Is there way to pass Symfony variables to translation without keys

we are now using custom translations for our project in PHP and I want to migrate them to Symfony ones. Everything looks great, but my only concern is that variable placeholders needs key to bind successfully, can I somehow change the code to accept translation variables in sequence (without keys)? Let me show an example: Our code now: But this

Unable to find template Symfony 4

When I updated from Symfony 3.4 to Symfony 4 and displayed the system with a browser, the following error appeared. Changing the views directory is a lot of work and I don’t want to do it as much as possible. Is there any good way? Error Code Code framework.yaml twig.yaml SecurityController.php Version Symfony 4.0 PHP 7.3 twig/twig 2.14 twig/templating 4.0

Connection refused to database (Symfony 5) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I’m trying to connect my database to my app with Symfony but I keep getting errors. I specify that it’s not a local database. Also, I’m

Advertisement