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'); }