I have a symfony crud actions , in the new and edit form I want to add bootstrap class to the datetime attribute.
here is the formType :
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('name', Field\TextType::class, array(
'label' => 'w2d.product.backend.event.entityFields.name',
'required' => true
))
->add('description', Field\TextareaType::class, array(
'label' => 'w2d.product.backend.event.entityFields.description',
'required' => true
))
->add('startDate', Field\DateTimeType::class, array(
'label' => 'w2d.product.backend.event.entityFields.startDate',
'required' => true
))
->add('endDate', Field\DateTimeType::class, array(
'label' => 'w2d.product.backend.event.entityFields.endDate',
'required' => true
));
}
and here is the twig form call :
{{ form_start(form) }}
{{ form_errors(form) }}
<fieldset>
{{ form_row(form.name) }}
</fieldset>
<fieldset>
{{ form_row(form.description) }}
</fieldset>
<fieldset>
{{ form_row(form.startDate) }}
</fieldset>
<fieldset>
{{ form_row(form.endDate) }}
</fieldset>
<fieldset class="txtRight">
<hr />
{% if event.id %}
<input type="submit" value="{{ 'w2d.core.global.update'|trans }}" />
{% else %}
<input type="submit" value="{{ 'w2d.core.global.add'|trans }}" />
{% endif %}
</fieldset>
{{ form_end(form) }}
Can some one help please , just I want the bootstrap class in the datetime field. Thanks !