From a3434504e60881a23c993097f8ee3e3750a76041 Mon Sep 17 00:00:00 2001 From: resurtm Date: Wed, 21 Dec 2016 14:01:59 +0600 Subject: [PATCH] wip --- .codeclimate.yml | 0 .../how-to-enhance-a-user-model.md | 3 +++ lib/User/resources/views/admin/index.php | 10 ++++------ lib/User/resources/views/shared/_alert.php | 6 +++--- lib/User/resources/views/shared/admin_layout.php | 6 ++++++ 5 files changed, 16 insertions(+), 9 deletions(-) delete mode 100644 .codeclimate.yml diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index e69de29..0000000 diff --git a/docs/enhancing-and-overriding/how-to-enhance-a-user-model.md b/docs/enhancing-and-overriding/how-to-enhance-a-user-model.md index 0013c71..4e25c82 100644 --- a/docs/enhancing-and-overriding/how-to-enhance-a-user-model.md +++ b/docs/enhancing-and-overriding/how-to-enhance-a-user-model.md @@ -46,6 +46,9 @@ feature. This is good approach too: ], ``` +> Please note, the method above works only starting from Yii 2.0.10 and upper. In version 2.0.9 and lower you can +> use explicit calls to DI container from application `bootstrap.php` file. + Finally you can now add new methods, properties, and other things to your new `User` model class: ```php diff --git a/lib/User/resources/views/admin/index.php b/lib/User/resources/views/admin/index.php index 49f6c79..b5179d3 100644 --- a/lib/User/resources/views/admin/index.php +++ b/lib/User/resources/views/admin/index.php @@ -9,17 +9,15 @@ * the LICENSE file that was distributed with this source code. */ -use Da\User\Search\UserSearch; -use yii\data\ActiveDataProvider; use yii\grid\GridView; use yii\helpers\Html; use yii\web\View; use yii\widgets\Pjax; -/* - * @var View $this - * @var ActiveDataProvider $dataProvider - * @var UserSearch $searchModel +/** + * @var $this yii\web\View + * @var $dataProvider yii\data\ActiveDataProvider + * @var $searchModel Da\User\Search\UserSearch */ $this->title = Yii::t('user', 'Manage users'); diff --git a/lib/User/resources/views/shared/_alert.php b/lib/User/resources/views/shared/_alert.php index 2d5c859..f13e20c 100644 --- a/lib/User/resources/views/shared/_alert.php +++ b/lib/User/resources/views/shared/_alert.php @@ -11,8 +11,8 @@ use yii\bootstrap\Alert; -/* - * @var \Da\User\Module $module +/** + * @var $module Da\User\Module */ ?> @@ -20,7 +20,7 @@ use yii\bootstrap\Alert;
session->getAllFlashes() as $type => $message): ?> - + ['class' => 'alert-dismissible alert-'.$type], 'body' => $message, diff --git a/lib/User/resources/views/shared/admin_layout.php b/lib/User/resources/views/shared/admin_layout.php index adf1cba..fb0aa46 100644 --- a/lib/User/resources/views/shared/admin_layout.php +++ b/lib/User/resources/views/shared/admin_layout.php @@ -11,14 +11,20 @@ use yii\helpers\Html; +/** + * @var $content string + */ + ?>
+ render( '/shared/_alert', [ 'module' => Yii::$app->getModule('user'), ] ) ?> +