我正在尝试根据数据范围选择器打印表列,为此,我需要将开始日期和结束日期存储在变量中。但我不知道如何存储。
这是代码,
<?= DateRangePicker::widget([
'name' => 'date_from',
'value' => '02-16-2012',
'nameTo' => 'name_to',
'valueTo' => '02-20-2012'
]);
?>
<?php
$count = Yii::$app->db->createCommand("
SELECT age,gender,mail_id,mobile_number,birth_date FROM requirement ")->queryScalar();
$provider = new SqlDataProvider([
'sql' => 'SELECT age,gender,mail_id,mobile_number,birth_date FROM requirement',
'totalCount' => $count,
'pagination' => [
'pageSize' => 10,
],
'sort' => [
'attributes' => [
'name'
],
],
]);
// returns an array of data rows
$models = $provider->getModels();
?>
请帮助我将日期范围存储在变量中。...