add user CRUD

This commit is contained in:
2015-09-19 08:29:47 +02:00
parent 271835ae6b
commit 5163f1a9a9
15 changed files with 653 additions and 14 deletions

View File

@@ -9,8 +9,12 @@ use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use common\widgets\Alert;
use backend\components\AdminMenuStructure;
AppAsset::register($this);
$adminMenu = new AdminMenuStructure();
$items = $adminMenu->run();
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
@@ -28,27 +32,15 @@ AppAsset::register($this);
<div class="wrap">
<?php
NavBar::begin([
'brandLabel' => 'My Company',
'brandLabel' => 'Botond Fitness WebAdmin',
'brandUrl' => Yii::$app->homeUrl,
'options' => [
'class' => 'navbar-inverse navbar-fixed-top',
],
]);
$menuItems = [
['label' => 'Home', 'url' => ['/site/index']],
];
if (Yii::$app->user->isGuest) {
$menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
} else {
$menuItems[] = [
'label' => 'Logout (' . Yii::$app->user->identity->username . ')',
'url' => ['/site/logout'],
'linkOptions' => ['data-method' => 'post']
];
}
echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right'],
'items' => $menuItems,
'items' => $items,
]);
NavBar::end();
?>