From 767d99c30bb8b7fc748304c057bf91dd74cf4e15 Mon Sep 17 00:00:00 2001 From: Luciano Baraglia Date: Thu, 23 May 2013 00:49:07 -0300 Subject: [PATCH] Fixing some outdated comments --- docs/guide/upgrade-from-v1.md | 8 +++++--- framework/yii/widgets/Menu.php | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/guide/upgrade-from-v1.md b/docs/guide/upgrade-from-v1.md index cc0de73..b3d4411 100644 --- a/docs/guide/upgrade-from-v1.md +++ b/docs/guide/upgrade-from-v1.md @@ -216,12 +216,14 @@ Using a widget is more straightforward in 2.0. You mainly use the `begin()`, `en methods of the `Widget` class. For example, ```php -// $this refers to the View object // Note that you have to "echo" the result to display it echo \yii\widgets\Menu::widget(array('items' => $items)); -// $this refers to the View object -$form = \yii\widgets\ActiveForm::begin($this); +// Passing an array to initialize the object properties +$form = \yii\widgets\ActiveForm::begin(array( + 'options' => array('class' => 'form-horizontal'), + 'fieldConfig' => array('inputOptions' => array('class' => 'input-xlarge')), +)); ... form inputs here ... \yii\widgets\ActiveForm::end(); ``` diff --git a/framework/yii/widgets/Menu.php b/framework/yii/widgets/Menu.php index e76f11f..d63f202 100644 --- a/framework/yii/widgets/Menu.php +++ b/framework/yii/widgets/Menu.php @@ -26,7 +26,6 @@ use yii\helpers\Html; * The following example shows how to use Menu: * * ~~~ - * // $this is the view object currently being used * echo Menu::widget(array( * 'items' => array( * // Important: you need to specify url as 'controller/action',