PHP development framework YiiFramework tutorial (38) Zii component-ProgressBar example
CJuiProgressBar displays a progress bar. It encapsulates the JUI Progressbar plug-in. CJuiProgressBar displays a progress bar. It encapsulates the JUI Progressbar plug-in.
Widget ('zii. widgets. jui. cjuiprogressbar', array (
'Id' => 'progress ',
'Value' => 0,
'Htmlopexception' => array (
'Style' => 'width: 200px; height: 20px; float: left ;'
),
));
?>
To demonstrate the progress bar, we use JavaScripts to change the current value of the progress bar and use a text to display the value of the current progress bar.
// Dummy function just to provide an example
Yii: app ()-> clientScript-> registerScript ('scriptid ',"
Var count = 0;
Var step = 10;
Var speed = 500;
Function progress (){
$ ('# Amount'). text (count + '% ');
$ ('# SS SS'). progressbar ('option', 'value', count );
If (count <100 ){
Count = count + step;
SetTimeout (progress, speed );
}
}
Progress ();
", CClientScript: POS_LOAD );
?>
...