/** * Returns the array of possible user roles. * NOTE: used in user/index view. * * @return mixed */ public static function getRolesList() { $roles = []; foreach (AuthItem::getRoles() as $item_name) { $roles[$item_name->name] = $item_name->name; } return $roles; }
public static function getCashierRole() { foreach (AuthItem::getRoles() as $item_name) { if ($item_name->name === 'cashier') { $role = $item_name->name; } } return $role; }
?> <?php echo Html::img([Yii::$app->params['avatar'], ['alt' => 'user', 'class' => 'tiny image']]); ?> <?php } ?> </div> <div class="ui center aligned content"> </div> <div class="extra content"> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12"> <?php foreach (AuthItem::getRoles() as $item_name) { ?> <?php $roles[$item_name->name] = ucfirst($item_name->name); ?> <?php } ?> <?php echo $form->field($role, 'item_name', ['inputTemplate' => '<label for="Role" style="font-weight: 600; color: #555;">Role</label>{input}'])->dropDownList($roles, ['class' => 'form-control pva-form-control'])->label(false); ?> </div> </div> </div> </div> </div>