repeat checkbox in table <td></td>

So I have this form here in a for. I'd like this checkbox form to repeat himself in every line of my table but it's only repeating the label correctly for each line. I need a way to repeat those Three checks in every line of my table.

Here is the controller (not sure by the way that I created the builder correctly:

<?php
$staffList = $this->getDoctrine()
                    ->getEntityManager()
                    ->getRepository('EnsgtiUserBundle:User')
                    ->findAll();

        $formAnnee = $this->createFormBuilder()
                            ->add('checkAnnee1', 'checkbox', array(
                                  'label'     => 'test test',
                                  'required'  => false,))
                            ->add('checkAnnee2', 'checkbox', array(
                                  'label'     => '',
                                  'required'  => false,))
                            ->add('checkAnnee3', 'checkbox', array(
                                  'label'     => '',
                                  'required'  => false,))
                            ->getForm();

        //return $this->redirect( $this->generateUrl('EnsgtiEnsgtiBundle_voirList'));
        return $this->render('EnsgtiEnsgtiBundle:Appli:voirStaffList.html.twig', array(
            'staffList' => $staffList,
            'formAnnee' => $formAnnee->createView(),
        ));

Here is the form:

{% for user in staffList %}
         <tr>
            <td class="tdVoirStaff"> {{user.nom}} </td>
            <td class="tdVoirStaff"> {{user.prenom}} </td>
            <td class="tdVoirStaff" nowrap> {{user.email}} </td>
            <td class="tdVoirStaff" nowrap>
                <form {{ form_enctype(formAnnee) }}>
                    {{ form_label(formAnnee.checkAnnee1, "1") }}
                    {{ form_errors(formAnnee.checkAnnee1) }}
                    {{ form_widget(formAnnee.checkAnnee1) }}

                    {{ form_label(formAnnee.checkAnnee2, "2") }}
                    {{ form_errors(formAnnee.checkAnnee2) }}
                    {{ form_widget(formAnnee.checkAnnee2) }}

                    {{ form_label(formAnnee.checkAnnee3, "3") }}
                    {{ form_errors(formAnnee.checkAnnee3) }}
                    {{ form_widget(formAnnee.checkAnnee3) }}
                </form>
            </td>
         </tr>
{% endfor %}

Answers


You can't drop HTML just in you have to post it like this :

<?php 
   echo"<put your html code here>";
?>

and you forget to close your option tags :)


Need Your Help

Simulate Python keypresses for controlling a game

python python-2.7 keypress simulate

I'm trying to control a game (my two test games are Half Life 2 and Minecraft) using my Kinect and Python. Everything works except for one thing. The game will respond to simulated mouse events and

In a C# solution, Where do you declare solution-scope enums?

c# enums projects-and-solutions

In a C# solution, Where do you declare solution-scope enums ?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.