cjuiprogressbar显示一进度条。它封装了 jui progressbar插件。cjuiprogressbar显示一进度条。它封装了 jui progressbar插件。
widget('zii.widgets.jui.cjuiprogressbar', array(
'id'=>'progress',
'value'=>0,
'htmloptions'=>array(
'style'=>'width:200px; height:20px; float:left;'
),
));
?>
为了演示进度条,我们使用javascripts改变进度条当前值,并使用一个文本显示当前进度条的值。
// 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+'%');
$('#progress').progressbar('option', 'value', count);
if(count < 100) {
count = count+step;
settimeout(progress, speed);
}
}
progress();
", cclientscript::pos_load);
?>
...
以上就是php开发框架yii framework教程(38) zii组件-progressbar示例的内容。