Answer the question
In order to leave comments, you need to log in
Symfony2 DateTime - where is the calendar? File - where is the loader? :(
Have a nice weekend everyone. Someone from the "Symphonists" can tell you - what bundle extends the standard forms so that the fields created according to the Doctrine receive "Normal" handlers?
Let me explain a little. There is a standard Entity with two fields:
/**
* @ORM\Column( type="datetime" , name="created_at")
* @ORM\GeneratedValue(strategy="AUTO")
* @Gedmo\Timestampable(on="create ")
*
* @var DateTime $createdAt initial load date
*/
protected $createdAt;
and
/**
* @Assert\File (maxSize="6000000")
*/
private $file;
The forms created by the Doctrine are extremely sad: for the date there are six lists (year, month, day, hour, month, second).
For a file, this is the standard "file".
Which bundle to connect so that a calendar is drawn for the date? I really don’t want to reinvent the wheel, inherit from the standard one and sculpt my own. These are typical tasks. There must be a couple of great solutions. from FOS, or from someone else ...
Ps <code kapets works like =/ you need to read man chtol ...
Answer the question
In order to leave comments, you need to log in
Firstly, the forms are not created by doctrine, but by a separate component.
Second, the date widget has a widget parameter:
->add('published', 'date', array(
'input' => 'datetime',
'widget' => 'single_text',
'label' => 'Дата публикации',
'format' => 'dd.MM.yyyy',
))
, which allows you to set the type of the input field. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question