如何使用yii booster在Editablefield中设置动态变量值?

时间:2013-01-03 12:43:44

标签: yii-extensions

我正在尝试在URL参数中传递变量$ time。整个小部件位于foreach循环内,每次执行lop时都会更新$time。现在我面临的问题是$ time(在url参数中传递)不会更新。

$dataProvider = StaffHours::model()->findAll(); 
  $start = strtotime('12:00am');
  $end = strtotime('12:45am');
for( $i = $start; $i <= $end; $i += 900) 
    {   
     $time = date('g:i A', $i);

     foreach($dataProvider as $data)
       { 
        $monday = unserialize($data->monday);

        $this->widget('bootstrap.widgets.TbEditableField', array(
                     'type' => 'select',
                     'model' => $data,
                     'attribute' => 'monday',
                     'url' => $this->createUrl('staffhours/editstaffhour&Time='.$time ), //url for submit data
                     'source' => array('Online', 'Offline', 'AwayDate'),
                     'enabled' => true,
                     'options' => array('params' => array('time'=>$time),)
                    ));
           }
     }

0 个答案:

没有答案