symfony-2.2

Build a form having a checkbox for each entity in a doctrine collection

谁都会走 提交于 2019-11-26 22:17:25
问题 I'm displaying an html table for a filtered collection of entities and I want to display a checkbox in each row as part of a form which will add the selected entities to a session var. I'm thinking that each checkbox should have the entity id as its value and I'll get an array of ids from the form field data (ok, so the value ought to be an indirect ref to the entity, but for the sake of simplicity). I've tried creating a form Type with a single entity type field, mapped to the id property of

How to insert a Controller in Twig with “render” in Symfony 2.2?

岁酱吖の 提交于 2019-11-26 19:42:31
问题 I'm upgrading my project from Symfony 2.0.22 to 2.2.0 and review somes changes, but i'm blocked on this : I would like to render (like in Sf 2.0.X) a header with their controller and the "render" twig method don't work for me. Their is the error : An exception has been thrown during the rendering of a template ("No route found for "GET Index:header"") in "OSSiteBundle:Index:index.html.twig". Here is the actual render method : {# src/OS/SiteBundle/Resources/views/layout.html.twig #} ... {%