I would like to pass a date range to my Controller function (an excel report), but am not sure how to do it.
In my menu I call the function as usual:
array('label'=>'Export Fee Earner Report', 'url'=>array('FearnerExcel', 'fid'=>$model->id, 'sdate1'=>$sdate1, 'edate1'=>$edate1))
And in my view I have the start and end date Datepickers for selection:
<div class="row">
<?php $this->widget('zii.widgets.jui.CJuiDatePicker',
array(
'name' => 'sdate1',
'options'=> array(
'dateFormat' =>'yy-mm-dd',
'altFormat' =>'yy-mm-dd',
'changeMonth' => true,
'changeYear' => true,
// 'yearRange'=>'1900:2050',
'appendText' => 'yyyy-mm-dd',
),
));
?>
</div>
<div class="row">
<?php $this->widget('zii.widgets.jui.CJuiDatePicker',
array(
'name' => 'edate1',
'options'=> array(
'dateFormat' =>'yy-mm-dd',
'altFormat' =>'yy-mm-dd',
'changeMonth' => true,
'changeYear' => true,
// 'yearRange'=>'1900:2050',
'appendText' => 'yyyy-mm-dd',
),
));
?>
</div>
with the same names sdate1 & edate1 as in my menu.
However even if I select the dates and then select the report menu function, updated values are not passed?
How could I make the menu sdate1 & edate1 be updated dynamically through the Datepickers?