-
1common/config/bootstrap.php
-
7common/config/main.php
-
66composer.json
-
184composer.lock
-
170console/migrations/m140506_102106_rbac_init.php
-
60console/migrations/m170907_052038_rbac_add_index_on_auth_assignment_user_id.php
-
64console/migrations/m180523_151638_rbac_updates_indexes_without_prefix.php
-
42console/migrations/m190802_072830_add_category.php
-
57console/migrations/schema-mysql.sql
-
1kcadmin/assets/AppAsset.php
-
6kcadmin/config/main.php
-
6kcadmin/controllers/SiteController.php
-
13kcadmin/views/layouts/breadcrumb.php
-
7kcadmin/views/layouts/footer.php
-
88kcadmin/views/layouts/header.php
-
66kcadmin/views/layouts/main.php
-
27kcadmin/views/layouts/sidebar.php
-
4kcadmin/views/site/index.php
-
15kcadmin/views/site/test.php
-
149kcadmin/web/css/site.css
-
BINkcadmin/web/images/robust-logo-light.png
-
BINkcadmin/web/images/robust-logo-small.png
-
BINkcadmin/web/img/avatar.png
-
BINkcadmin/web/img/avatar04.png
-
BINkcadmin/web/img/avatar2.png
-
BINkcadmin/web/img/avatar3.png
-
BINkcadmin/web/img/avatar5.png
-
BINkcadmin/web/img/credit/american-express.png
-
BINkcadmin/web/img/credit/cirrus.png
-
BINkcadmin/web/img/credit/mastercard.png
-
BINkcadmin/web/img/credit/mestro.png
-
BINkcadmin/web/img/credit/paypal.png
-
BINkcadmin/web/img/credit/paypal2.png
-
BINkcadmin/web/img/credit/visa.png
-
BINkcadmin/web/img/default-50x50.gif
-
BINkcadmin/web/img/icons.png
-
BINkcadmin/web/img/photo1.png
-
BINkcadmin/web/img/photo2.png
-
BINkcadmin/web/img/photo3.jpg
-
BINkcadmin/web/img/photo4.jpg
-
BINkcadmin/web/img/user1-128x128.jpg
-
BINkcadmin/web/img/user2-160x160.jpg
-
BINkcadmin/web/img/user3-128x128.jpg
-
BINkcadmin/web/img/user4-128x128.jpg
-
BINkcadmin/web/img/user5-128x128.jpg
-
BINkcadmin/web/img/user6-128x128.jpg
-
BINkcadmin/web/img/user7-128x128.jpg
-
BINkcadmin/web/img/user8-128x128.jpg
@ -1,13 +1,18 @@ |
|||
<?php |
|||
|
|||
return [ |
|||
'aliases' => [ |
|||
'@bower' => '@vendor/bower-asset', |
|||
'@npm' => '@vendor/npm-asset', |
|||
'@npm' => '@vendor/npm-asset', |
|||
'@blobt' => '@vendor/blobt' |
|||
], |
|||
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', |
|||
'components' => [ |
|||
'cache' => [ |
|||
'class' => 'yii\caching\FileCache', |
|||
], |
|||
'authManager' => [ |
|||
'class' => 'yii\rbac\DbManager', |
|||
], |
|||
], |
|||
]; |
@ -1,34 +1,38 @@ |
|||
{ |
|||
"name": "blobt/kcbasic", |
|||
"description": "This is a fast template using for small project in KcDev.", |
|||
"type": "project", |
|||
"license": "MIT", |
|||
"authors": [ |
|||
{ |
|||
"name": "blobt", |
|||
"email": "380255922@qq.com" |
|||
} |
|||
], |
|||
"minimum-stability": "dev", |
|||
"require": { |
|||
"php": ">=7.1.0", |
|||
"yiisoft/yii2": "~2.0.14", |
|||
"yiisoft/yii2-bootstrap": "^2.0@dev", |
|||
"yiisoft/yii2-gii": "^2.0@dev" |
|||
}, |
|||
"repositories": { |
|||
"kc_packagist": { |
|||
"type": "composer", |
|||
"url": "https://packagist.kcshop.com.cn/" |
|||
}, |
|||
"name": "blobt/kcbasic", |
|||
"description": "This is a fast template using for small project in KcDev.", |
|||
"type": "project", |
|||
"license": "MIT", |
|||
"authors": [ |
|||
{ |
|||
"name": "blobt", |
|||
"email": "380255922@qq.com" |
|||
} |
|||
], |
|||
"minimum-stability": "dev", |
|||
"require": { |
|||
"php": ">=7.1.0", |
|||
"yiisoft/yii2": "~2.0.14", |
|||
"yiisoft/yii2-bootstrap": "^2.0@dev" |
|||
}, |
|||
"repositories": { |
|||
"asset_packagist": { |
|||
"type": "composer", |
|||
"url": "https://asset-packagist.org" |
|||
}, |
|||
"kc_packagist": { |
|||
"type": "composer", |
|||
"url": "https://packagist.kcshop.com.cn/" |
|||
}, |
|||
|
|||
"packagist": { |
|||
"type": "composer", |
|||
"url": "https://packagist.phpcomposer.com" |
|||
} |
|||
}, |
|||
"require-dev": { |
|||
"yiisoft/yii2-debug": "^2.0@dev", |
|||
"kint-php/kint": "dev-master" |
|||
} |
|||
"packagist": { |
|||
"type": "composer", |
|||
"url": "https://packagist.phpcomposer.com" |
|||
} |
|||
}, |
|||
"require-dev": { |
|||
"yiisoft/yii2-debug": "^2.0@dev", |
|||
"kint-php/kint": "dev-master", |
|||
"yiisoft/yii2-gii": "^2.0@dev" |
|||
} |
|||
} |
@ -0,0 +1,170 @@ |
|||
<?php |
|||
/** |
|||
* @link http://www.yiiframework.com/ |
|||
* @copyright Copyright (c) 2008 Yii Software LLC |
|||
* @license http://www.yiiframework.com/license/ |
|||
*/ |
|||
|
|||
use yii\base\InvalidConfigException; |
|||
use yii\rbac\DbManager; |
|||
|
|||
/** |
|||
* Initializes RBAC tables. |
|||
* |
|||
* @author Alexander Kochetov <creocoder@gmail.com> |
|||
* @since 2.0 |
|||
*/ |
|||
class m140506_102106_rbac_init extends \yii\db\Migration |
|||
{ |
|||
/** |
|||
* @throws yii\base\InvalidConfigException |
|||
* @return DbManager |
|||
*/ |
|||
protected function getAuthManager() |
|||
{ |
|||
$authManager = Yii::$app->getAuthManager(); |
|||
if (!$authManager instanceof DbManager) { |
|||
throw new InvalidConfigException('You should configure "authManager" component to use database before executing this migration.'); |
|||
} |
|||
|
|||
return $authManager; |
|||
} |
|||
|
|||
/** |
|||
* @return bool |
|||
*/ |
|||
protected function isMSSQL() |
|||
{ |
|||
return $this->db->driverName === 'mssql' || $this->db->driverName === 'sqlsrv' || $this->db->driverName === 'dblib'; |
|||
} |
|||
|
|||
protected function isOracle() |
|||
{ |
|||
return $this->db->driverName === 'oci'; |
|||
} |
|||
|
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$authManager = $this->getAuthManager(); |
|||
$this->db = $authManager->db; |
|||
$schema = $this->db->getSchema()->defaultSchema; |
|||
|
|||
$tableOptions = null; |
|||
if ($this->db->driverName === 'mysql') { |
|||
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
|
|||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; |
|||
} |
|||
|
|||
$this->createTable($authManager->ruleTable, [ |
|||
'name' => $this->string(64)->notNull(), |
|||
'data' => $this->binary(), |
|||
'created_at' => $this->integer(), |
|||
'updated_at' => $this->integer(), |
|||
'PRIMARY KEY ([[name]])', |
|||
], $tableOptions); |
|||
|
|||
$this->createTable($authManager->itemTable, [ |
|||
'name' => $this->string(64)->notNull(), |
|||
'type' => $this->smallInteger()->notNull(), |
|||
'description' => $this->text(), |
|||
'rule_name' => $this->string(64), |
|||
'data' => $this->binary(), |
|||
'created_at' => $this->integer(), |
|||
'updated_at' => $this->integer(), |
|||
'PRIMARY KEY ([[name]])', |
|||
'FOREIGN KEY ([[rule_name]]) REFERENCES ' . $authManager->ruleTable . ' ([[name]])' . |
|||
$this->buildFkClause('ON DELETE SET NULL', 'ON UPDATE CASCADE'), |
|||
], $tableOptions); |
|||
$this->createIndex('idx-auth_item-type', $authManager->itemTable, 'type'); |
|||
|
|||
$this->createTable($authManager->itemChildTable, [ |
|||
'parent' => $this->string(64)->notNull(), |
|||
'child' => $this->string(64)->notNull(), |
|||
'PRIMARY KEY ([[parent]], [[child]])', |
|||
'FOREIGN KEY ([[parent]]) REFERENCES ' . $authManager->itemTable . ' ([[name]])' . |
|||
$this->buildFkClause('ON DELETE CASCADE', 'ON UPDATE CASCADE'), |
|||
'FOREIGN KEY ([[child]]) REFERENCES ' . $authManager->itemTable . ' ([[name]])' . |
|||
$this->buildFkClause('ON DELETE CASCADE', 'ON UPDATE CASCADE'), |
|||
], $tableOptions); |
|||
|
|||
$this->createTable($authManager->assignmentTable, [ |
|||
'item_name' => $this->string(64)->notNull(), |
|||
'user_id' => $this->string(64)->notNull(), |
|||
'created_at' => $this->integer(), |
|||
'PRIMARY KEY ([[item_name]], [[user_id]])', |
|||
'FOREIGN KEY ([[item_name]]) REFERENCES ' . $authManager->itemTable . ' ([[name]])' . |
|||
$this->buildFkClause('ON DELETE CASCADE', 'ON UPDATE CASCADE'), |
|||
], $tableOptions); |
|||
|
|||
if ($this->isMSSQL()) { |
|||
$this->execute("CREATE TRIGGER {$schema}.trigger_auth_item_child
|
|||
ON {$schema}.{$authManager->itemTable} |
|||
INSTEAD OF DELETE, UPDATE |
|||
AS |
|||
DECLARE @old_name VARCHAR (64) = (SELECT name FROM deleted) |
|||
DECLARE @new_name VARCHAR (64) = (SELECT name FROM inserted) |
|||
BEGIN |
|||
IF COLUMNS_UPDATED() > 0 |
|||
BEGIN |
|||
IF @old_name <> @new_name |
|||
BEGIN |
|||
ALTER TABLE {$authManager->itemChildTable} NOCHECK CONSTRAINT FK__auth_item__child; |
|||
UPDATE {$authManager->itemChildTable} SET child = @new_name WHERE child = @old_name; |
|||
END |
|||
UPDATE {$authManager->itemTable} |
|||
SET name = (SELECT name FROM inserted), |
|||
type = (SELECT type FROM inserted), |
|||
description = (SELECT description FROM inserted), |
|||
rule_name = (SELECT rule_name FROM inserted), |
|||
data = (SELECT data FROM inserted), |
|||
created_at = (SELECT created_at FROM inserted), |
|||
updated_at = (SELECT updated_at FROM inserted) |
|||
WHERE name IN (SELECT name FROM deleted) |
|||
IF @old_name <> @new_name |
|||
BEGIN |
|||
ALTER TABLE {$authManager->itemChildTable} CHECK CONSTRAINT FK__auth_item__child; |
|||
END |
|||
END |
|||
ELSE |
|||
BEGIN |
|||
DELETE FROM {$schema}.{$authManager->itemChildTable} WHERE parent IN (SELECT name FROM deleted) OR child IN (SELECT name FROM deleted); |
|||
DELETE FROM {$schema}.{$authManager->itemTable} WHERE name IN (SELECT name FROM deleted); |
|||
END |
|||
END;");
|
|||
} |
|||
} |
|||
|
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function down() |
|||
{ |
|||
$authManager = $this->getAuthManager(); |
|||
$this->db = $authManager->db; |
|||
|
|||
if ($this->isMSSQL()) { |
|||
$this->execute('DROP TRIGGER {$schema}.trigger_auth_item_child;'); |
|||
} |
|||
|
|||
$this->dropTable($authManager->assignmentTable); |
|||
$this->dropTable($authManager->itemChildTable); |
|||
$this->dropTable($authManager->itemTable); |
|||
$this->dropTable($authManager->ruleTable); |
|||
} |
|||
|
|||
protected function buildFkClause($delete = '', $update = '') |
|||
{ |
|||
if ($this->isMSSQL()) { |
|||
return ''; |
|||
} |
|||
|
|||
if ($this->isOracle()) { |
|||
return ' ' . $delete; |
|||
} |
|||
|
|||
return implode(' ', ['', $delete, $update]); |
|||
} |
|||
} |
@ -0,0 +1,60 @@ |
|||
<?php |
|||
/** |
|||
* @link http://www.yiiframework.com/ |
|||
* @copyright Copyright (c) 2008 Yii Software LLC |
|||
* @license http://www.yiiframework.com/license/ |
|||
*/ |
|||
|
|||
use yii\base\InvalidConfigException; |
|||
use yii\db\Migration; |
|||
use yii\rbac\DbManager; |
|||
|
|||
/** |
|||
* Adds index on `user_id` column in `auth_assignment` table for performance reasons. |
|||
* |
|||
* @see https://github.com/yiisoft/yii2/pull/14765 |
|||
* |
|||
* @author Ivan Buttinoni <ivan.buttinoni@cibi.it> |
|||
* @since 2.0.13 |
|||
*/ |
|||
class m170907_052038_rbac_add_index_on_auth_assignment_user_id extends Migration |
|||
{ |
|||
public $column = 'user_id'; |
|||
public $index = 'auth_assignment_user_id_idx'; |
|||
|
|||
/** |
|||
* @throws yii\base\InvalidConfigException |
|||
* @return DbManager |
|||
*/ |
|||
protected function getAuthManager() |
|||
{ |
|||
$authManager = Yii::$app->getAuthManager(); |
|||
if (!$authManager instanceof DbManager) { |
|||
throw new InvalidConfigException('You should configure "authManager" component to use database before executing this migration.'); |
|||
} |
|||
|
|||
return $authManager; |
|||
} |
|||
|
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$authManager = $this->getAuthManager(); |
|||
$this->db = $authManager->db; |
|||
|
|||
$this->createIndex($this->index, $authManager->assignmentTable, $this->column); |
|||
} |
|||
|
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function down() |
|||
{ |
|||
$authManager = $this->getAuthManager(); |
|||
$this->db = $authManager->db; |
|||
|
|||
$this->dropIndex($this->index, $authManager->assignmentTable); |
|||
} |
|||
} |
@ -0,0 +1,64 @@ |
|||
<?php |
|||
/** |
|||
* @link http://www.yiiframework.com/ |
|||
* @copyright Copyright (c) 2008 Yii Software LLC |
|||
* @license http://www.yiiframework.com/license/ |
|||
*/ |
|||
|
|||
use yii\base\InvalidConfigException; |
|||
use yii\db\Migration; |
|||
use yii\rbac\DbManager; |
|||
|
|||
/** |
|||
* Updates indexes without a prefix. |
|||
* |
|||
* @see https://github.com/yiisoft/yii2/pull/15548 |
|||
* |
|||
* @author Sergey Gonimar <sergey.gonimar@gmail.com> |
|||
* @since 2.0.16 |
|||
*/ |
|||
class m180523_151638_rbac_updates_indexes_without_prefix extends Migration |
|||
{ |
|||
/** |
|||
* @throws yii\base\InvalidConfigException |
|||
* @return DbManager |
|||
*/ |
|||
protected function getAuthManager() |
|||
{ |
|||
$authManager = Yii::$app->getAuthManager(); |
|||
if (!$authManager instanceof DbManager) { |
|||
throw new InvalidConfigException('You should configure "authManager" component to use database before executing this migration.'); |
|||
} |
|||
|
|||
return $authManager; |
|||
} |
|||
|
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$authManager = $this->getAuthManager(); |
|||
|
|||
$this->dropIndex('auth_assignment_user_id_idx', $authManager->assignmentTable); |
|||
$this->createIndex('{{%idx-auth_assignment-user_id}}', $authManager->assignmentTable, 'user_id'); |
|||
|
|||
$this->dropIndex('idx-auth_item-type', $authManager->itemTable); |
|||
$this->createIndex('{{%idx-auth_item-type}}', $authManager->itemTable, 'type'); |
|||
} |
|||
|
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function down() |
|||
{ |
|||
$authManager = $this->getAuthManager(); |
|||
|
|||
$this->dropIndex('{{%idx-auth_assignment-user_id}}', $authManager->assignmentTable); |
|||
$this->createIndex('auth_assignment_user_id_idx', $authManager->assignmentTable, 'user_id'); |
|||
|
|||
|
|||
$this->dropIndex('{{%idx-auth_item-type}}', $authManager->itemTable); |
|||
$this->createIndex('idx-auth_item-type', $authManager->itemTable, 'type'); |
|||
} |
|||
} |
@ -0,0 +1,42 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m190802_072830_add_category |
|||
*/ |
|||
class m190802_072830_add_category extends Migration |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function safeUp() |
|||
{ |
|||
|
|||
} |
|||
|
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function safeDown() |
|||
{ |
|||
echo "m190802_072830_add_category cannot be reverted.\n"; |
|||
|
|||
return false; |
|||
} |
|||
|
|||
/* |
|||
// Use up()/down() to run migration code without a transaction.
|
|||
public function up() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
echo "m190802_072830_add_category cannot be reverted.\n"; |
|||
|
|||
return false; |
|||
} |
|||
*/ |
|||
} |
@ -0,0 +1,57 @@ |
|||
/** |
|||
* Database schema required by \yii\rbac\DbManager. |
|||
* |
|||
* @author Qiang Xue <qiang.xue@gmail.com> |
|||
* @author Alexander Kochetov <creocoder@gmail.com> |
|||
* @link http://www.yiiframework.com/ |
|||
* @copyright 2008 Yii Software LLC |
|||
* @license http://www.yiiframework.com/license/ |
|||
* @since 2.0 |
|||
*/ |
|||
|
|||
drop table if exists `auth_assignment`; |
|||
drop table if exists `auth_item_child`; |
|||
drop table if exists `auth_item`; |
|||
drop table if exists `auth_rule`; |
|||
|
|||
create table `auth_rule` |
|||
( |
|||
`name` varchar(64) not null, |
|||
`data` blob, |
|||
`created_at` integer, |
|||
`updated_at` integer, |
|||
primary key (`name`) |
|||
) engine InnoDB; |
|||
|
|||
create table `auth_item` |
|||
( |
|||
`name` varchar(64) not null, |
|||
`type` smallint not null, |
|||
`description` text, |
|||
`rule_name` varchar(64), |
|||
`data` blob, |
|||
`created_at` integer, |
|||
`updated_at` integer, |
|||
primary key (`name`), |
|||
foreign key (`rule_name`) references `auth_rule` (`name`) on delete set null on update cascade, |
|||
key `type` (`type`) |
|||
) engine InnoDB; |
|||
|
|||
create table `auth_item_child` |
|||
( |
|||
`parent` varchar(64) not null, |
|||
`child` varchar(64) not null, |
|||
primary key (`parent`, `child`), |
|||
foreign key (`parent`) references `auth_item` (`name`) on delete cascade on update cascade, |
|||
foreign key (`child`) references `auth_item` (`name`) on delete cascade on update cascade |
|||
) engine InnoDB; |
|||
|
|||
create table `auth_assignment` |
|||
( |
|||
`item_name` varchar(64) not null, |
|||
`user_id` varchar(64) not null, |
|||
`created_at` integer, |
|||
primary key (`item_name`, `user_id`), |
|||
foreign key (`item_name`) references `auth_item` (`name`) on delete cascade on update cascade, |
|||
key `auth_assignment_user_id_idx` (`user_id`) |
|||
) engine InnoDB; |
@ -0,0 +1,13 @@ |
|||
<?PHP |
|||
|
|||
use yii\widgets\Breadcrumbs; |
|||
?>
|
|||
<?php if (!empty($this->title)): ?>
|
|||
<h1><?= $this->title ?><?php if (isset($this->params['subtitle'])): ?><small><?= $this->params['subtitle'] ?></small><?php endif ?></h1>
|
|||
<?php endif ?>
|
|||
<?php |
|||
echo Breadcrumbs::widget([ |
|||
'tag' => 'ol', |
|||
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], |
|||
]); |
|||
?>
|
@ -0,0 +1,7 @@ |
|||
<footer class="main-footer"> |
|||
<div class="pull-right hidden-xs"> |
|||
<b>Version</b> 0.1.0 |
|||
</div> |
|||
<strong>Copyright © 2014-2019 <a href="https://kuaichuangkeji.com">KcAdmin</a>.</strong> All rights |
|||
reserved. |
|||
</footer> |
@ -0,0 +1,88 @@ |
|||
<?php |
|||
|
|||
use yii\helpers\Html; |
|||
?>
|
|||
<header class="main-header"> |
|||
<!-- Logo --> |
|||
<a href="/" class="logo"> |
|||
<!-- mini logo for sidebar mini 50x50 pixels --> |
|||
<span class="logo-mini"><b>K</b>c</span> |
|||
<!-- logo for regular state and mobile devices --> |
|||
<span class="logo-lg"><b>KC</b>admin</span> |
|||
</a> |
|||
<!-- Header Navbar: style can be found in header.less --> |
|||
<nav class="navbar navbar-static-top"> |
|||
<div class="navbar-menu"> |
|||
<ul class="nav navbar-nav"> |
|||
<li> |
|||
<!-- Sidebar toggle button--> |
|||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button"> |
|||
<span class="sr-only">Toggle navigation</span> |
|||
</a> |
|||
</li> |
|||
<!-- TODO:后续处理 --> |
|||
<!--li class="user user-menu"> |
|||
<a href="#"> |
|||
<i class="fa fa-dashboard"></i> |
|||
<span class="hidden-xs">面板</span> |
|||
</a> |
|||
</li> |
|||
<li class="user user-menu"> |
|||
<a href="#"> |
|||
<i class="fa fa-shopping-cart"></i> |
|||
<span class="hidden-xs">商城</span> |
|||
</a> |
|||
</li> |
|||
<li class="user user-menu"> |
|||
<a href="#"> |
|||
<i class="fa fa-wechat"></i> |
|||
<span class="hidden-xs">微信</span> |
|||
</a> |
|||
</li> |
|||
<li class="user user-menu"> |
|||
<a href="#"> |
|||
<i class="fa fa-cubes"></i> |
|||
<span class="hidden-xs">进销存</span> |
|||
</a> |
|||
</li> |
|||
<li class="user user-menu"> |
|||
<a href="#"> |
|||
<i class="fa fa-cogs"></i> |
|||
<span class="hidden-xs">系统</span> |
|||
</a> |
|||
</li--> |
|||
</ul> |
|||
</div> |
|||
<div class="navbar-custom-menu"> |
|||
<ul class="nav navbar-nav"> |
|||
|
|||
<li class="dropdown user user-menu"> |
|||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
|||
<img src="/img/user2-160x160.jpg" class="user-image" alt="User Image"> |
|||
<span class="hidden-xs"><?= yii::$app->user->identity->username ?></span>
|
|||
</a> |
|||
<ul class="dropdown-menu"> |
|||
<!-- User image --> |
|||
<li class="user-header"> |
|||
<img src="/img/user2-160x160.jpg" class="img-circle" alt="User Image"> |
|||
|
|||
<p> |
|||
<?= yii::$app->user->identity->username ?>
|
|||
<small>Member since <?= date('m-d-Y', yii::$app->user->identity->created_at) ?></small>
|
|||
</p> |
|||
</li> |
|||
<!-- Menu Footer--> |
|||
<li class="user-footer"> |
|||
<div class="pull-left"> |
|||
<?= Html::a('个人设置', ['/site/profile'], ['class' => 'btn btn-default btn-flat']) ?>
|
|||
</div> |
|||
<div class="pull-right"> |
|||
<?= Html::a('退出', ['/site/logout'], ['data-method' => 'post', 'class' => 'btn btn-default btn-flat']) ?>
|
|||
</div> |
|||
</li> |
|||
</ul> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</nav> |
|||
</header> |
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
use blobt\widgets\Menu; |
|||
?>
|
|||
<aside class="main-sidebar"> |
|||
<!-- sidebar: style can be found in sidebar.less --> |
|||
<section class="sidebar"> |
|||
<?php |
|||
echo Menu::widget([ |
|||
'items' => [ |
|||
['label' => 'MAIN NAVIGATION', 'is_header' => true], |
|||
['label' => 'IndexController', 'url' => '#', 'icon' => 'fa-hand-o-right', 'items' => [ |
|||
['label' => 'Index', 'url' => ['site/index', 'tag' => 'new']], |
|||
['label' => 'Test', 'url' => ['site/test']], |
|||
] |
|||
], |
|||
['label' => 'GoodsController', 'url' => '#', 'icon' => 'fa-hand-o-right', 'items' => [ |
|||
['label' => 'sasa', 'url' => ['goods/sasa', 'tag' => 'new']], |
|||
['label' => 'dada', 'url' => ['goods/dada', 'tag' => 'popular']], |
|||
] |
|||
] |
|||
] |
|||
]); |
|||
?>
|
|||
</section> |
|||
<!-- /.sidebar --> |
|||
</aside> |
@ -1,4 +1,6 @@ |
|||
<?php |
|||
/* @var $this yii\web\View */ |
|||
$this->title = 'My Yii Application'; |
|||
$this->title = 'Dashboard'; |
|||
$this->params['subtitle'] = 'Control panel'; |
|||
$this->params['breadcrumbs'][] = $this->title; |
|||
?>
|
Before Width: 117 | Height: 25 | Size: 3.9 KiB |
Before Width: 32 | Height: 18 | Size: 2.0 KiB |
After Width: 215 | Height: 215 | Size: 7.9 KiB |
After Width: 215 | Height: 215 | Size: 13 KiB |
After Width: 215 | Height: 215 | Size: 8.1 KiB |
After Width: 215 | Height: 215 | Size: 9.0 KiB |
After Width: 215 | Height: 215 | Size: 7.4 KiB |
After Width: 51 | Height: 32 | Size: 2.1 KiB |
After Width: 51 | Height: 32 | Size: 1.5 KiB |
After Width: 51 | Height: 32 | Size: 1.6 KiB |
After Width: 52 | Height: 32 | Size: 1.5 KiB |
After Width: 101 | Height: 64 | Size: 2.0 KiB |
After Width: 51 | Height: 32 | Size: 1.2 KiB |
After Width: 51 | Height: 32 | Size: 1.0 KiB |
After Width: 50 | Height: 50 | Size: 184 B |
After Width: 61 | Height: 37 | Size: 1.1 KiB |
After Width: 1250 | Height: 835 | Size: 656 KiB |
After Width: 1254 | Height: 836 | Size: 412 KiB |
After Width: 2000 | Height: 1333 | Size: 383 KiB |
After Width: 2000 | Height: 1320 | Size: 1.1 MiB |
After Width: 128 | Height: 128 | Size: 2.8 KiB |
After Width: 160 | Height: 160 | Size: 6.9 KiB |
After Width: 128 | Height: 128 | Size: 3.4 KiB |
After Width: 128 | Height: 128 | Size: 3.4 KiB |
After Width: 128 | Height: 128 | Size: 6.3 KiB |
After Width: 128 | Height: 128 | Size: 4.2 KiB |
After Width: 128 | Height: 128 | Size: 6.3 KiB |
After Width: 128 | Height: 128 | Size: 4.9 KiB |