Yii Framework Forum: How To Set Dynamic Variable Value In Editablefield Using Yii Booster - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Set Dynamic Variable Value In Editablefield Using Yii Booster Rate Topic: -----

#1 User is offline   hari maliya 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 31-May 12

Posted 03 January 2013 - 07:50 AM

HI Guys,

I am trying to pass a variable $time in thr URL parameter. The whole widget is inside a foreach lopp and $time is updated each time the lopp is executed. Now the problem I am facing is that the $time (which is passed in url parameter) is not updated.

$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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users