konadrian
konadrian

Reputation: 581

How to use datepicker in Symfony2

I want to add datepicker in my code. I downloaded bootstrap-datepicke. But how add correct this component? I tried something like this

<form action="{{ path('pattient_test') }}" method="post" >
   <input type="text" id="pick" value="02/16/12" data-date-format="mm/dd/yy" class="datepicker" >
   <input type="submit" value="Prześlij zmienione dane"/>
</form> 

And then in controller

 var_dump( $this->get('request')->request->get('pick'));

But I still get NULL

Upvotes: 0

Views: 1792

Answers (1)

Ahmed Siouani
Ahmed Siouani

Reputation: 13891

Try by adding name attribute to your pick input field,

name="pick"

Also,

var_dump( $this->get('request')->request->all()); Allows you to check all POST parameters, it may help you figure out what's going wrong.

Upvotes: 2

Related Questions