Skip to content
Advertisement

Tag: symfony

Get data from multiple rows

I would like to get the value of the column uid from all rows where the value of the column city is london. I have tried it like this: $this->getDoctrine()->getRepository(Personal::class)->…

select2 does not display correctly (Using cdn)

I’m trying to complete my website with some java’s plugin, I’m on Symfony 4 and I use the CDN bootstrap twitter. When I put the select2 plugin into the templates all is working properly, the select2 plugin does apply correctly. However I don’t want to load select2 directly from the templates I want to run it from app.js but it

Symfony OneToMany Assiociations not working

I have Product entity and ProductAttachment entity. One product should be able to have many attachments. I Used Doctrine mapping OneToMnay – ManyToOne but everytime i get product, it has empty $files collection ProductAttachment Entity Product Entity Am i Missing anything? When i call this is what i get Answer The problem is Doctrine’s lazy loading of collections, which is

How to inject global variables into all templates?

In my twig template there are some variables that are required on each page like userName, userId or userImage. What is the best way to inject them into the template? I already read the article How to Inject Variables into all Templates but how could I write a variable (e.g. current user) into the config/packages/twig.php file? Right now there is

Advertisement