I have an entity in My Symfony project with a field "brand' that is nullable false. I want it to be required true for the client side. However, it isn't working. Did something change in the bundle? I can't find what the problem is.
The entity:
/**
* @var string
*
* @ORM\Column(name="brand", type="string", length=255, nullable=false)
*/
private $brand;
The form:
->add('translations', 'a2lix_translations', array(
'fields' => array(
'brand' => array(
'field_type' => TextType::class,
'required' => true
),
)
)
)`
I also tried this but still no required appears in the front:
->add('translations', 'a2lix_translations', array(
'fields' => array(
'brand' => array(
'field_type' => TextType::class,
'locale_options' => array(
'en' => array(
'required' => true
),
'fr' => array(
'required' => true
)
)
),
)
)
)`
The result in both cases in the browser is:
<input type="text" id="video_form_translations_en_brand" name="video_form[translations][en][brand]" maxlength="255" class="form-control">