Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8210251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:00:48+00:00 2026-06-07T10:00:48+00:00

UPDATE: I just to precise that I’m new to Symfony2 and generally with frameworks.

  • 0

UPDATE: I just to precise that I’m new to Symfony2 and generally with frameworks. I would like to clarify my question: I wish a big form with many fields and the label of each field is from a second DB. It would take 30minutes in pure PHP without a framework, but how can I do it with Sf2?

I’m having an issue to display in one form multiple times the same entity.
Here is the context:
I have a parking lot with multiple parking places. To manage at best the parking lot,it is decided to give a priority order to each parking place to be occuped.
The manager of the parking lot can change the priorities at any moment but a historical must be in place.
The parking places are already declared and the manager can’t edit them.
So to do so, I have created to entities: ParkingPlaces and Historical. Historical as ManyToOne ParkingPlaces.
I wish that for each parking place label, there is a field to enter the occupation priority in one form.
The entities are declared as such:

class Historical
{
  /**
   * @ORM\Column(name="date", type="datetime")
   */
  private date;
  /**
   * @ORM\ManyToOne(targetEntity="ParkingPlace")
   * @ORM\JoinColumn(name="parkingplace_id", referencedColumnName="id")
   */
  private parkingPlace;
  /**
   * @ORM\Column(name="priority", type="integer")
   */
  private priority;
}

class ParkingPlace
{
  /**
   * @ORM\Column(name="name", type="string", lenght=255)
   */
  private name;
  /**
   * @ORM\OneToMany(targetEntity="Historical", mappedBy="parkingPlace")
   */
  private historical;
}

And that is the render I wish:

<form>
  <fieldset>
    <legend>Parking A1</legend>
    <input name="priority" type="number" />
  </fieldset>
  <fieldset>
    <legend>Parking A2</legend>
    <input name="priority" type="number" />
  </fieldset>
  <fieldset>
    <legend>Parking A3</legend>
    <input name="priority" type="number" />
  </fieldset>
  <fieldset>
    <legend>Parking A4</legend>
    <input name="priority" type="number" />
  </fieldset>
  ...
</form>

I have spent many hours on it, but I didn’t any solution. I have tried many solution on Stack but none answers my problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:00:50+00:00Added an answer on June 7, 2026 at 10:00 am

    I managed to answer the question. I changed the DB architecture and used a ‘Collection’ field in my form.

    I leave here the entire code. I hope it will help other people.

    History Entity

    //src/Xxx/YyyBundle/Entity/History.php
    namespace Xxx\YyyBundle\Entity;
    
    use Doctrine\Common\Collections\ArrayCollection;
    use Doctrine\ORM\Mapping as ORM;
    use Symfony\Component\Validator\Constraints as Assert;
    use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
    
    /**
     * Xxx\YyyBundle\Entity\History
     *
     * @ORM\Table()
     * @ORM\Entity(repositoryClass="Xxx\YyyBundle\Entity\HistoryRepository")
     * @UniqueEntity(
     *      fields="name",
     *      message="Il existe déjà une table ayant ce nom."
     * )
     */
    class History
    {
        /**
         * @var integer $id
         *
         * @ORM\Column(name="id", type="integer")
         * @ORM\Id
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        private $id;
    
        /**
         * @var string $name
         *
         * @ORM\Column(name="name", type="string", length=255, unique=true)
         * @Assert\NotBlank(message="Le nom de la table a été oublié")
         */
        private $name;
    
        /**
         * @var datetime $date
         *
         * @ORM\Column(name="date", type="datetime")
         */
        private $date;
    
        /**
         * @var Xxx\ZzzBundle\Entity\User $agent
         *
         * @ORM\ManyToOne(targetEntity="Ratp\AgentBundle\Entity\User")
         * @ORM\JoinColumn(name="agent_id", referencedColumnName="id")
         */
        private $agent;
    
        /**
         * @var Xxx\YyyBundle\Entity\ParkingPlacePriority $agent
         *
         * @ORM\OneToMany(targetEntity="ParkingPlacePriority", mappedBy="history", cascade={"persist"})
         * @Assert\Valid(traverse=true)
         */
        private $parkingPlacesPriorities;
    
    
        /**
         * Constructeur
         *
         * @return string 
         */
        public function __construct()
        {
            $this->parkingPlacesPriorities = new ArrayCollection();
        }
    
        /**
         * Get History's name
         *
         * @return string 
         */
        public function __toString()
        {
            return $this->name;
        }
    
        /**
         * Get id
         *
         * @return integer 
         */
        public function getId()
        {
            return $this->id;
        }
    
        /**
         * Set name
         *
         * @param string $name
         */
        public function setName($name)
        {
            $this->name = $name;
        }
    
        /**
         * Get name
         *
         * @return string 
         */
        public function getName()
        {
            return $this->name;
        }
    
        /**
         * Set date
         *
         * @param datetime $date
         */
        public function setDate($date)
        {
            $this->date = $date;
        }
    
        /**
         * Get date
         *
         * @return datetime 
         */
        public function getDate()
        {
            return $this->date;
        }
    
        /**
         * Set agent
         *
         * @param Xxx\ZzzBundle\Entity\User $agent
         */
        public function setAgent(\Xxx\ZzzBundle\Entity\User $agent)
        {
            $this->agent = $agent;
        }
    
        /**
         * Get agent
         *
         * @return Xxx\ZzzBundle\Entity\User 
         */
        public function getAgent()
        {
            return $this->agent;
        }
    
        /**
         * Set parkingPlacesPriorities
         *
         * @param Xxx\YyyBundle\Entity\ParkingPlacePriority $agent
         */
        public function setParkingPlacesPriorities(ArrayCollection $parkingPlacesPriorities)
        {
            $this->parkingPlacesPriorities = $parkingPlacesPriorities;
    
            foreach($parkingPlacesPriorities as $parkingPlacePriority)
            {
                $parkingPlacePriority->setHistory($this);
            }
        }
    
        /**
         * Get parkingPlacesPriorities
         *
         * @return Xxx\YyyBundle\Entity\ParkingPlacePriority 
         */
        public function addParkingPlacesPriorities(\Xxx\YyyBundle\Entity\ParkingPlacePriority $parkingPlacesPriorities)
        {
            return $this->parkingPlacesPriorities[] = $parkingPlacesPriorities;
    
            foreach($parkingPlacesPriorities as $parkingPlacePriority)
            {
                $parkingPlacePriority->setHistory($this);
            }
        }
    
        /**
         * Get parkingPlacesPriorities
         *
         * @return Xxx\YyyBundle\Entity\ParkingPlacePriority 
         */
        public function getParkingPlacesPriorities()
        {
            return $this->parkingPlacesPriorities;
        }
    }
    

    ParkingPlace Entity

    //src/Xxx/YyyBundle/Entity/ParkingPlace.php
    namespace Xxx\YyyBundle\Entity;
    
    use Doctrine\ORM\Mapping as ORM;
    use Symfony\Component\Validator\Constraints as Assert;
    
    /**
     * Xxx\YyyBundle\Entity\ParkingPlace
     *
     * @ORM\Table()
     * @ORM\Entity(repositoryClass="Xxx\YyyBundle\Entity\ParkingPlaceRepository")
     */
    class ParkingPlace
    {
        /**
         * @var integer $id
         *
         * @ORM\Column(name="id", type="integer")
         * @ORM\Id
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        private $id;
    
        /**
         * @var integer $orderSequence
         *
         * @ORM\Column(name="orderSequence", type="integer")
         * @Assert\Min(
         *      limit="1",
         *      message="L'ordre d'affichage ne peux être inférieure à 1",
         *      invalidMessage="L'ordre d'affichage doit être un chiffre"
         * )
         */
        private $orderSequence;
    
        /**
         * @var string $name
         *
         * @ORM\Column(name="name", type="string", length=255)
         * @Assert\MinLength(
         *      limit=1,
         *      message="Le nom SAET doit comporter au minimum 1 caractère"
         * )
         * @Assert\MaxLength(
         *      limit=255,
         *      message="Le nom SAET doit comporter au maximum 255 caractères"
         * )
         * @Assert\Regex(
         *      pattern="/^[a-z0-9-]+$/i",
         *      message="Le nom d'exploitation contient des caractères invalides (seul les caractères alphanumériques et le tiret '-' sont acceptés)"
         * )
         */
        private $name;
    
        /**
         * @var string $saetName
         *
         * @ORM\Column(name="saetName", type="string", length=255, unique=true)
         * @Assert\MinLength(
         *      limit=5,
         *      message="Le nom SAET doit comporter au minimum 5 caractères"
         * )
         * @Assert\MaxLength(
         *      limit=255,
         *      message="Le nom SAET doit comporter au maximum 255 caractères"
         * )
         * @Assert\Regex(
         *      pattern="/^prk_/i",
         *      message="Le nom SAET ne commence pas par 'PRK_'"
         * )
         * @Assert\Regex(
         *      pattern="/^[a-z0-9_]+$/i",
         *      message="Le nom SAET  contient des caractères invalides (seul les caractères alphanumériques et le trait de soulignemet '_' sont acceptés)"
         * )
         */
        private $saetName;
    
        /**
         * @var string $rail
         *
         * @ORM\Column(name="rail", type="string", length=5)
         * @Assert\NotBlank()
         * @Assert\MinLength(
         *      limit=1,
         *      message="Le nom SAET doit comporter au minimum 1 caractères"
         * )
         * @Assert\MaxLength(
         *      limit=5,
         *      message="Le nom SAET doit comporter au maximum 5 caractères"
         * )
         */
        private $rail;
    
        /**
         * @var Xxx\YyyBundle\Entity\ParkingZone $parkingZone
         *
         * @ORM\ManyToOne(targetEntity="ParkingZone")
         * @ORM\JoinColumn(name="parkingzone_id", referencedColumnName="id")
         */
        private $parkingZone;
    
    
        /**
         * Get ParkingPlace's name
         *
         * @return string 
         */
        public function __toString()
        {
            return $this->name;
        }
    
        /**
         * Get id
         *
         * @return integer 
         */
        public function getId()
        {
            return $this->id;
        }
    
        /**
         * Set orderSequence
         *
         * @param integer $orderSequence
         */
        public function setOrderSequence($orderSequence)
        {
            $this->orderSequence = $orderSequence;
        }
    
        /**
         * Get orderSequence
         *
         * @return integer 
         */
        public function getOrderSequence()
        {
            return $this->orderSequence;
        }
    
        /**
         * Set name
         *
         * @param string $name
         */
        public function setName($name)
        {
            $this->name = strtoupper($name);
        }
    
        /**
         * Get name
         *
         * @return string 
         */
        public function getName()
        {
            return $this->name;
        }
    
        /**
         * Set saetName
         *
         * @param string $saetName
         */
        public function setSaetName($saetName)
        {
            $this->saetName = strtoupper($saetName);
        }
    
        /**
         * Get saetName
         *
         * @return string 
         */
        public function getSaetName()
        {
            return $this->saetName;
        }
    
        /**
         * Set rail
         *
         * @param string $rail
         */
        public function setRail($rail)
        {
            $this->rail = strtoupper($rail);
        }
    
        /**
         * Get rail
         *
         * @return string 
         */
        public function getRail()
        {
            return $this->rail;
        }
    
        /**
         * Set parkingZone
         *
         * @param Xxx\YyyBundle\Entity\ParkingZone $parkingZone
         */
        public function setParkingZone(\Xxx\YyyBundle\Entity\ParkingZone $parkingZone)
        {
            $this->parkingZone = $parkingZone;
        }
    
        /**
         * Get parkingZone
         *
         * @return Xxx\YyyBundle\Entity\ParkingZone 
         */
        public function getParkingZone()
        {
            return $this->parkingZone;
        }
    }
    

    ParkingPlacePriority Entity

    //src/Xxx/YyyBundle/Entity/ParkingPlacePriority.php
    namespace Xxx\YyyBundle\Entity;
    
    use Xxx\YyyBundle\RatpGarageL1Bundle;
    use Symfony\Component\Validator\Constraints as Assert;
    use Doctrine\ORM\Mapping as ORM;
    
    /**
     * Xxx\YyyBundle\Entity\ParkingPlacePriority
     *
     * @ORM\Table()
     * @ORM\Entity(repositoryClass="Xxx\YyyBundle\Entity\ParkingPlacePriorityRepository")
     */
    class ParkingPlacePriority
    {
        /**
         * @var integer $id
         *
         * @ORM\Column(name="id", type="integer")
         * @ORM\Id
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        private $id;
    
        /**
         * @var Xxx\YyyBundle\Entity\ParkingPlace $parkingPlace
         *
         * @ORM\ManyToOne(targetEntity="ParkingPlace")
         * @ORM\JoinColumn(name="parkingplace_id", referencedColumnName="id")
         */
        private $parkingPlace;
    
        /**
         * @var Xxx\YyyBundle\Entity\History $history
         *
         * @ORM\ManyToOne(targetEntity="History", cascade={"persist"})
         * @ORM\JoinColumn(name="history_id", referencedColumnName="id")
         */
        private $history;
    
        /**
         * @var integer $priorityIn
         *
         * @ORM\Column(name="priorityIn", type="integer")
         * @Assert\NotBlank(message="La priorité de garage n'as pas été donné")
         * @Assert\Min(
         *      limit="1",
         *      message="La priorité de garage ne peux être inférieure à 1",
         *      invalidMessage="La priorité doit être un chiffre"
         * )
         */
        private $priorityIn;
    
        /**
         * @var integer $priorityOut
         *
         * @ORM\Column(name="priorityOut", type="integer")
         * @Assert\NotBlank(message="La priorité de dégarage n'as pas été donné")
         * @Assert\Min(
         *      limit="1",
         *      message="La priorité de dégarage ne peux être inférieure à 1",
         *      invalidMessage="La priorité doit être un chiffre"
         * )
         */
        private $priorityOut;
    
    
        /**
         * Get id
         *
         * @return integer 
         */
        public function getId()
        {
            return $this->id;
        }
    
        /**
         * Set priorityIn
         *
         * @param integer $priorityIn
         */
        public function setPriorityIn($priorityIn)
        {
            $this->priorityIn = $priorityIn;
        }
    
        /**
         * Get priorityIn
         *
         * @return integer 
         */
        public function getPriorityIn()
        {
            return $this->priorityIn;
        }
    
        /**
         * Set priorityOut
         *
         * @param integer $priorityOut
         */
        public function setPriorityOut($priorityOut)
        {
            $this->priorityOut = $priorityOut;
        }
    
        /**
         * Get priorityOut
         *
         * @return integer 
         */
        public function getPriorityOut()
        {
            return $this->priorityOut;
        }
    
        /**
         * Set parkingPlace
         *
         * @param Xxx\YyyBundle\Entity\ParkingPlace $parkingPlace
         */
        public function setParkingPlace(\Xxx\YyyBundle\Entity\ParkingPlace $parkingPlace)
        {
            $this->parkingPlace = $parkingPlace;
        }
    
        /**
         * Get parkingPlace
         *
         * @return Xxx\YyyBundle\Entity\ParkingPlace 
         */
        public function getParkingPlace()
        {
            return $this->parkingPlace;
        }
    
        /**
         * Set history
         *
         * @param Xxx\YyyBundle\Entity\History $history
         */
        public function setHistory(\Xxx\YyyBundle\Entity\History $history)
        {
            $this->history = $history;
        }
    
        /**
         * Get history
         *
         * @return Xxx\YyyBundle\Entity\History 
         */
        public function getHistory()
        {
            return $this->history;
        }
    }
    

    History Controller

    //src/Xxx/YyyBundle/Controller/HistoryController.php
    namespace Xxx\YyyBundle\Controller;
    
    use Xxx\YyyBundle\Entity\ParkingPlacePriority;
    use Xxx\YyyBundle\Entity\ParkingPlace;
    use Symfony\Bundle\FrameworkBundle\Controller\Controller;
    use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
    use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
    use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
    use Xxx\YyyBundle\Entity\History;
    use Xxx\YyyBundle\Form\HistoryType;
    
    /**
     * History controller.
     *
     * @Route("")
     */
    class HistoryController extends Controller
    {
        /**
         * Lists all History entities.
         *
         * @Route("/", name="history")
         * @Template()
         */
        public function indexAction()
        {
            $em = $this->getDoctrine()->getEntityManager();
    
            $entities = $em->getRepository('XxxYyyBundle:History')->findAll();
    
            return array('entities' => $entities);
        }
    
        /**
         * Displays a form to create a new History entity.
         *
         * @Route("/new", name="history_new")
         * @Template()
         */
        public function newAction()
        {
            $em = $this->getDoctrine()->getEntityManager();
            $entities = $em->getRepository('XxxYyyBundle:ParkingPlace')->findAllOrdered();
            $parkingZones = $em->getRepository('XxxYyyBundle:ParkingZone')->findAllOrdered();
    
            $history = new History();
            foreach ($entities as $entity)
            {
                $parkingPlacePriority = new ParkingPlacePriority();
                $parkingPlacePriority->setParkingPlace($entity);
                $history->addParkingPlacesPriorities($parkingPlacePriority);
            }
            $form   = $this->createForm(new HistoryType(), $history);
    
            return array(
                'entity' => $history,
                'parkingPlaces' => $entities,
                'parkingZones' => $parkingZones,
                'form'   => $form->createView()
            );
        }
    
        /**
         * Creates a new History entity.
         *
         * @Route("/create", name="history_create")
         * @Method("post")
         * @Template("XxxYyyBundle:History:new.html.twig")
         */
        public function createAction()
        {
            $em = $this->getDoctrine()->getEntityManager();
            $entities = $em->getRepository('XxxYyyBundle:ParkingPlace')->findAllOrdered();
            $parkingZones = $em->getRepository('XxxYyyBundle:ParkingZone')->findAllOrdered();
    
            $history  = new History();
            foreach ($entities as $entity)
            {
                $parkingPlacePriority = new ParkingPlacePriority();
                $parkingPlacePriority->setParkingPlace($entity);
                $history->addParkingPlacesPriorities($parkingPlacePriority);
            }
            $history->setDate(new \DateTime());
            $history->setAgent($this->container->get('security.context')->getToken()->getUser());
    
            $request = $this->getRequest();
            $form   = $this->createForm(new HistoryType(), $history);
            $form->bindRequest($request);
    
            if ($form->isValid()) {
                $em = $this->getDoctrine()->getEntityManager();
                $em->persist($history);
                $em->flush();
    
                return $this->redirect($this->generateUrl('parkingplacepriority_export', array('id' => $history->getId())));
    
            }
    
            return array(
                'entity' => $history,
                'parkingPlaces' => $entities,
                'parkingZones' => $parkingZones,
                'form'   => $form->createView()
            );
        }
    
        /**
         * Displays a form to edit an existing History entity.
         *
         * @Route("/{id}/edit", name="history_edit")
         * @Template("XxxYyyBundle:History:new.html.twig")
         */
        public function editAction($id)
        {
            $em = $this->getDoctrine()->getEntityManager();
            $parkingPlaces = $em->getRepository('XxxYyyBundle:ParkingPlace')->findAllOrdered();
            $parkingZones = $em->getRepository('XxxYyyBundle:ParkingZone')->findAllOrdered();
    
            $entity = $em->getRepository('XxxYyyBundle:History')->find($id);
    
            if (!$entity) {
                throw $this->createNotFoundException('Unable to find History entity.');
            }
    
            $entity->setName('');
            $editForm = $this->createForm(new HistoryType(), $entity);
    
            return array(
                'entity'      => $entity,
                'parkingPlaces' => $parkingPlaces,
                'parkingZones' => $parkingZones,
                'form'        => $editForm->createView(),
            );
        }
    
        /**
         * Edits an existing History entity.
         *
         * @Route("/{id}/update", name="history_update")
         * @Method("post")
         * @Template("XxxYyyBundle:History:new.html.twig")
         */
        public function updateAction($id)
        {
            $em = $this->getDoctrine()->getEntityManager();
    
            $entity = $em->getRepository('XxxYyyBundle:History')->find($id);
    
            if (!$entity) {
                throw $this->createNotFoundException('Unable to find History entity.');
            }
    
            $editForm   = $this->createForm(new HistoryType(), $entity);
            $deleteForm = $this->createDeleteForm($id);
    
            $request = $this->getRequest();
    
            $editForm->bindRequest($request);
    
            if ($editForm->isValid()) {
                $em->persist($entity);
                $em->flush();
    
                return $this->redirect($this->generateUrl('parkingplacepriority_export', array('id' => $id)));
            }
    
            return array(
                'entity'      => $entity,
                'edit_form'   => $editForm->createView(),
            );
        }
    }
    

    History FormType

    //src/Xxx/YyyBundle/Form/HistoryType.php
    namespace Xxx\YyyBundle\Form;
    
    use Symfony\Component\Form\AbstractType;
    use Symfony\Component\Form\FormBuilder;
    
    class HistoryType extends AbstractType
    {
        public function buildForm(FormBuilder $builder, array $options)
        {
            $builder
                ->add('name', 'text', array(
                        'max_length' => 255,
                        'trim' => true,
                        )
                    )
                ->add('parkingPlacesPriorities', 'collection', array(
                        'type' => new ParkingPlacePriorityType(),
                        'by_reference' => false,
                        )
                    )
            ;
        }
    
        public function getName()
        {
            return 'xxx_yyybundle_historytype';
        }
    }
    

    ParkingPlacePriority FormType

    //src/Xxx/YyyBundle/Form/ParkingPlacePriorityType.php
    namespace Xxx\YyyBundle\Form;
    
    use Symfony\Component\Form\AbstractType;
    use Symfony\Component\Form\FormBuilder;
    
    class ParkingPlacePriorityType extends AbstractType
    {
        public function buildForm(FormBuilder $builder, array $options)
        {
            $builder
                ->add('priorityIn', 'number', array(
                        'precision' => 0,
                        )
                    )
                ->add('priorityOut', 'number', array(
                        'precision' => 0,
                        )
                    )
                ->add('parkingPlace', 'entity', array(
                        'class' => 'RatpGarageL1Bundle:ParkingPlace',
                        'read_only' => true,
                        )
                    )
            ;
        }
    
        public function getName()
        {
            return 'xxx_yyybundle_parkingplaceprioritytype';
        }
    }
    

    History new entity form template

    // src/Xxx/YyyBundle/Resources/views/History/new.html.twig
    {% extends '::base.html.twig' %}
    
    {% block title %}
        {{ parent() }} | Historique | Nouvelle table
    {%  endblock %}
    
    {% block zoneMenu %}
        <li class="">
            <a href="" id="save">Enregistrer</a>
        </li>
        <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                Zone de garage
                <b class="caret"></b>
            </a>
            <ul class="dropdown-menu">
            {% for parkingZone in parkingZones %}
                <li class="">
                    <a href="#{{ parkingZone.id }}">{{ parkingZone.name }}</a>
                </li>
            {% endfor %}
            </ul>
        </li>
    {% endblock %}
    
    {% block content %}
    
    <h1>Nouvelle table de garage/dégarage</h1>
    
    <form action="{{ path('history_create') }}" method="post" {{ form_enctype(form) }} class="form-horizontal">
        <div class="row-fluid">
        <div class="control-group offset7 {% if form_errors(form.name) | length > 0 %}error{% endif %}">
            {{ form_label(form.name, 'Nom de la table', { 'attr': {'class': 'control-label'} } ) }}
            <div class="controls error">
                {{ form_widget(form.name, { 'attr': {'class': ''} } ) }}
                <span class="help-inline">{{ form_errors(form.name) }}</span>
            </div>
        </div>
        </div>
        {% set voie = '0' %}
        {% set zone = '0' %}
        {% set i = 0 %}
        {% for pkPl in form.parkingPlacesPriorities %}
            {% if voie != parkingPlaces[i].rail %}
                {% if voie != '0' %}
            </fieldset>
                {% endif %}
                {% if zone != parkingPlaces[i].parkingZone %}
                    {% if zone != '0' %}
        </div>
                    {% endif %}
        <div id="{{ parkingPlaces[i].parkingZone.id }}" class="zone row-fluid">
            <h3 class="">{{ parkingPlaces[i].parkingZone.name }}</h3>
            <div class="synoptique">
                <span>{{ asset('bundles/xxxyyy/images/' ~ parkingPlaces[i].parkingZone.image) }}</span>
            </div>
                {% endif %}
                {% set zone = parkingPlaces[i].parkingZone %}
            <fieldset class="voie">
                {% set voie = parkingPlaces[i].rail %}
                <legend class=""><strong>Voie {{ parkingPlaces[i].rail }}</strong></legend>
            {% endif %}
                <fieldset name="{{ parkingPlaces[i].name }}" class="place_garage span5">
                    <legend>{{ parkingPlaces[i].name }}</legend>
                    <div class="control-group  {% if form_errors(pkPl.priorityIn) | length > 0 %}error{% endif %}">
                        {{ form_label(pkPl.priorityIn, 'Garage', { 'attr': {'class': 'control-label'} } ) }}
                        <div class="controls error">
                            {{ form_widget(pkPl.priorityIn, { 'attr': {'class': 'garage'} } ) }}
                            <span class="help-inline">{{ form_errors(pkPl.priorityIn) }}</span>
                        </div>
                    </div>
                    <div class="control-group  {% if form_errors(pkPl.priorityOut) | length > 0 %}error{% endif %}">
                        {{ form_label(pkPl.priorityOut, 'Dégarage', { 'attr': {'class': 'control-label'} } ) }}
                        <div class="controls">
                            {{ form_widget(pkPl.priorityOut, { 'attr': {'class': 'degarage'} } ) }}
                            <span class="help-inline">{{ form_errors(pkPl.priorityOut) }}</span>
                        </div>
                    </div>
                    <div class="control-group">
                        {{ form_label(pkPl.parkingPlace, 'Place de garage', { 'attr': {'class': 'control-label'} } ) }}
                        <div class="controls error">
                            {{ form_widget(pkPl.parkingPlace, { 'attr': {'class': ''} } ) }}
                            <span class="help-inline">{{ form_errors(pkPl.parkingPlace) }}</span>
                        </div>
                    </div>
                </fieldset>
            {% set i = i + 1 %}
        {% endfor %}
            </fieldset>
        </div>
        {{ form_rest(form) }}
        <div class="form-actions">
            <button type="submit" class="btn btn-primary">Enregistrer</button>
            <a href="{{ path('history') }}" class="btn">Annuler</a>
        </div>
    </form>
    
    {% endblock %}
    
    {% block javascript %}
            <script src="{{ asset('bundles/xxxyyy/js/script.js') }}"></script>
    {% endblock %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE: Just to be clear, I'd like to check the key-value of the 'name'
Update Just for future reference, I'm going to list all of the statistics that
UPDATE: Just to summarize what my question has boiled down to: I was hoping
Update: I just tested my JSON format returned from the server using JSONlint and
I just update firefox and they use a smooth slide effect(When the mouse wheel
I just update my ADT and SDK to latest version of ADT r20 and
Update I have just tried Pinning my site to the Taskbar again (after removing
I have developed a windows forms c# application, i just want update items in
i just want to update my local files with git. but every time i
UPDATE Turns out I'm just tired. There isn't any problem here sorry for wasting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.