Skip to content
Advertisement

Tag: symfony

How to get Doctrine to log queries in Symfony2

I’m pretty new to Symfony2, and I’m looking for a way to log SQL queries (including timings) to the same log file as the rest of my application. From what I can determine from the documentation this should all work out of the box, but after a few hours of trying I can’t figure out what I’m doing wrong. config_dev.yml

Twig get url parameter with []

I have an url like : MYURL?filter[_per_page]=25&filter[name][value]=hello How can i get these parameters with twig ? I’m trying {{ app.request.get(‘filter[_per_page]’) }} but it’s always empty… Thanks ! Edit : I’m in javascript an i want to assign this result to a javascript variable like : var param = “{{ app.request.get(‘filter[_per_page]’) }}”; Answer You must manage as an array accessing to

Doctrine : Default value on joinColumn field

New to symfony2 and Doctrine. How can I set a default value to the field foo_id (which is a reference on Foo table) to point on the ID 1 of the Foo table (which exists in all cases) ? I tried a lot of things without success : Set default value to ID 1 in the constructor of Foo Perform

Advertisement