CJuiProgressBar displays a progress bar. It encapsulates the JUI Progressbar plugin. CJuiProgressBar displays a progress bar. It encapsulates the JUI Progressbar plugin.
widget('zii.widgets.jui.CJuiProgressBar', array( 'id'=>'progress', 'value'=>0, 'htmlOptions'=>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 current value of the 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+'%'); $('#progress').progressbar('option', 'value', count); if(count < 100) { count = count+step; setTimeout(progress, speed); } } progress(); ", CClientScript::POS_LOAD); ?> ...
The above is the content of the PHP development framework Yii Framework tutorial (38) Zii component-ProgressBar example. For more related content, please pay attention to the PHP Chinese website (www.php.cn )!