protected function findModel($name) { if (($model = \app\modules\admin\models\rbac\Role::find($name)) !== null) { return $model; } else { throw new NotFoundHttpException(Yii::t('rbac', 'The requested page does not exist.')); } }
<?php use app\modules\admin\models\rbac\Role; $authManager = Yii::$app->authManager; $permissions = Role::getRolePermissions($model->name); $first = ''; $rows = []; foreach ($permissions as $permission) { if (empty($first)) { $first = $permission->name; } else { $rows[] = '<tr><td>' . $permission->name . '</td></tr>'; } } ?> <div class="permistion-item-view"> <table class="table table-striped table-bordered detail-view"> <tbody> <tr><th><?php echo $model->attributeLabels()['name']; ?> </th><td><?php echo $model->name; ?> </td></tr> <tr><th><?php echo $model->attributeLabels()['description']; ?> </th><td><?php echo $model->description; ?>