From f3554048a90886c4716d7b5e54042ddd751838ae Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Fri, 24 May 2013 22:04:29 +0400 Subject: [PATCH] ProgressBar enhancement --- framework/yii/jui/ProgressBar.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/framework/yii/jui/ProgressBar.php b/framework/yii/jui/ProgressBar.php index ab07620..6861a22 100644 --- a/framework/yii/jui/ProgressBar.php +++ b/framework/yii/jui/ProgressBar.php @@ -16,13 +16,27 @@ use yii\helpers\Html; * For example: * * ```php - * echo Progressbar::widget(array( + * echo ProgressBar::widget(array( * 'clientOptions' => array( * 'value' => 75, * ), * )); * ``` * + * The following example will show the content enclosed between the [[begin()]] + * and [[end()]] calls within the widget container: + * + * ~~~php + * ProgressBar::widget(array( + * 'clientOptions' => array( + * 'value' => 75, + * ), + * )); + * + * echo '
Loading...
'; + * + * ProgressBar::end(); + * ~~~ * @see http://api.jqueryui.com/progressbar/ * @author Alexander Kochetov * @since 2.0 @@ -30,11 +44,19 @@ use yii\helpers\Html; class ProgressBar extends Widget { /** + * Initializes the widget. + */ + public function init() + { + parent::init(); + echo Html::beginTag('div', $this->options) . "\n"; + } + + /** * Renders the widget. */ public function run() { - echo Html::beginTag('div', $this->options) . "\n"; echo Html::endTag('div') . "\n"; $this->registerWidget('progressbar'); }