formssymfonysymfony-2.8

Symfony Form add just a Label


What is the way of add just label into a form and modify its value with the entity atribute value related to the form. PRE_SET_DATA event is properly executed but I don't know how to set its value. Picture code and result:

enter image description here

Cheers!


Solution

  • There is no way to just add a label (without textArea) dynamically, at least in Symfony 2.8 . I worked it around using an non-mapped disabled text without label.

    enter image description here

    You have to ADD again the same element name into PRE_SET_DATA function and 'thanks God Symfony' it keeps the order.

    Cheers everyone!!