duanpo2813
duanpo2813
2013-03-20 09:52
浏览 23
已采纳

如何在Symfony2中使用datepicker

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

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongqi3533
    dongqi3533 2013-03-20 09:54
    已采纳

    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.

    点赞 评论

相关推荐