L
L
Lev K2016-05-18 19:13:30
Yii
Lev K, 2016-05-18 19:13:30

How to use yii widget for variable and not model?

Hello!
There is a yii widget for date/time picker ( date-time-picker ).
It is written that it should be used in this way:

use dosamigos\datetimepicker\DateTimePicker;
?>
<?= $form->field($model, 'date_from')->widget(DateTimePicker::className(), [
    'language' => 'es',
    'size' => 'ms',
    ... other params 
    ]
]);?>

And I need to use this widget to select a date range (without models). Roughly speaking, two widgets on the form and 2 dates are sent by submitting the form. How can I do that ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kosarinin, 2016-05-18
@Leffken

<?= DateTimePicker::widget([
    'name' => 'date_from',
    'language' => 'es',
    'size' => 'ms',
    ... other params 
    ]);
?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question