i have some probleme, i would like to have a default value in my datetime twig, i dont want to have the defaut value from BuildForm cause i use it for other twigs.
My add twig
<div class="form-group">
{{ form_label(form.Url, "Le URL", {'label_attr': {'class': 'col-sm-4 textTab control-label'}}) }}
{{ form_errors(form.Url) }}
<div class="col-sm-6">
{{ form_widget(form.Url, {'attr': {'class': 'form-control'}}) }}
</div>
</div>
<div class="form-group">
{{ form_label(form.dateDeLaDemande, "Date de la demande du crawl", {'label_attr': {'class': 'col-sm-4 textTab control-label'}}) }}
{{ form_errors(form.dateDeLaDemande) }}
<div class="col-sm-6" style="margin-top: 8px;">
{{ form_widget(form.dateDeLaDemande, {'attr': {'class': 'col-sm-6'}}) }}
</div>
</div>
<div class="form-group">
{{ form_label(form.DateDuCrawl, "Date du crawl", {'label_attr': {'class': 'col-sm-4 textTab control-label'}}) }}
{{ form_errors(form.DateDuCrawl) }}
<div class="col-sm-6" style="margin-top: 8px;">
{{ form_widget(form.DateDuCrawl, {'attr': {'class': 'col-sm-6' }}) }}
</div>
</div>
And my buildFom
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('site','text')
->add('Url','url')
->add('dateDeLaDemande','date')
->add('DateDuCrawl','date')
->add('DateNextCrawl','date')
->add('faitVP', 'checkbox', array('required' => false))
->add('integrerMavec','checkbox', array('required' => false))
// ->add('historique','textarea')
->add('historiques', 'collection', array(
'type' => new CategoryType(),
'allow_add' => true,
'allow_delete' => true
))
->add('save','submit')
;
}
Can some one help me plz ? thanks and sorry about my english :)