php - Symfony custom DateTime Control

I'm new to symfony and would like to create a custom datetime control and am currently struggling with the twig template as the datetime control seems to be a compound of the date and time control and all my attempts to create a new one fail.
The control should look like this:
A separate datepicker and a separate time picker which shows a dropdown list of times according to step setting (not a separate dropdown for hour and minute).
I tried with creating an AbstractType but failed to get the data correctly mapped into it.
What's the best way to create this control without affecting the normal DateTimeType rendering (should be separate) and without affecting DateType and TimeType either?
Answer
Solution:
First, if new data format for this field is not needed, as I understand, You shouldn't create new form Type class. Use standard DateTimeType and override twig template for this form filed.
Form field template can be override by create global by own 'form.html.twig' template or for single form by creating template for given field in form template as described in How to Work with Form Themes. If You need new control only in some cases and want to use normal template in general, create new 'form.html.twig' with custom template and use declaration:
{% form_theme form 'form.html.twig' %}
on top of twig template where form is rendered.
As You noticed, DateTimeType is compound from DateType and TimeType, and as long as You wish to use separate inputs for both types, You can override templates blocks for DateType and for TiemType separately. If You need single input for both override DateTimeType template block.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: sqlstate[hy000] [1698] access denied for user 'root'@'localhost'
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.