Vegas CMF Form Elements

Vegas\Forms\Element\Birthdaypicker

Simple input with bootstrap-datetimepicker. By default, date will be saved as array, read saved value part for more details.

All required js and css files are included in vegas library. Check installation guide for more details.

Configuration

namespace Foo\Forms;

use Vegas\Forms\Element\Birthdaypicker;

class Bar extends \Vegas\Forms\Form
{
    public function initialize()
    {
        $date = new Birthdaypicker('date');
        $date->getDecorator()->setTemplateName('jquery');
        $this->add($date);

        // ...
    }
}

Saved value

Lets assume that you will choose 1984-10-14 in datepicker and submit form with filled date field. Binding model with given form will give you following results:


$form = new Foo\Forms\Bar();
$form->bind($postData, $model);

echo $model->date['year']; // output: 1984
echo $model->date['month']; // output: 10
echo $model->date['day']; // output: 14