PHP development framework Yii Framework tutorial (38) Zii component-ProgressBar example

黄舟
Release: 2023-03-05 09:30:01
Original
1643 people have browsed it

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;'
),
));
?>
Copy after login

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);
?>
...
Copy after login

PHP development framework Yii Framework tutorial (38) Zii component-ProgressBar example

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 )!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!