quickie: setting symfony datetime default

Setting the default value for a symfony form field is one of those tasks so simple that it’s impossible to find out how to do it without a good bit of trial and error.  So without further ado, here is how to set a DateTime field’s default value:

$this->widgetSchema['start_time']->setDefault(date("m/d/Y", now()));

Till Next Time

Tags: , , , , , ,

One Response to “quickie: setting symfony datetime default”

  1. 456 says:

    Olga

    Otkuda material ?

Leave a Reply