funson86 / yii2-advanced-funson86
基于Yii 2 Advanced应用模板定制
0.0.1
2015-02-26 05:45 UTC
Requires
- php: >=5.4.0
- vova07/yii2-fileapi-widget: *
- yiisoft/yii2: *
- yiisoft/yii2-bootstrap: *
- yiisoft/yii2-swiftmailer: *
Requires (Dev)
This package is not auto-updated.
Last update: 2024-09-24 02:27:24 UTC
README
后端用户 & 密码:登录: admin
密码: qwe1234
安装和入门
如果您没有Composer,您可以通过在getcomposer.org上遵循说明来安装它。
- 运行以下命令以安装Yii2-Advanced-funson86:
php composer.phar create-project --stability=dev funson86/yii2-advanced-funson86 yii2-advanced
- 运行命令:
cd /my/path/to/yii2-advanced/
进入主应用程序目录。 - 运行命令:
php requirements.php
检查需求。 - 运行命令:
php init
以特定环境初始化应用程序。 - 创建一个新的数据库,并相应地调整
common/config/main-local.php
中的配置。 - 运行命令:
yii migrate
使用控制台命令应用迁移- m140608_201405_user_init : 用户表
- 运行命令:
yii migrate --migrationPath=@funson86/auth/migrations
以应用 https://github.com/funson86/yii2-auth - 这将创建应用程序运行所需的所有表。
- 您也可以从
my/path/to/yii2-advanced/tests/yii2-advanced-funson86.sql
下载数据库转储,但我建议使用迁移。 - 您也可以从 http://pan.baidu.com/s/1kT6FsoB 下载,sql文件在根路径中。
使用方法
- 使用URL
http://yii2-advanced-funson86.domain
指向yii2-advanced-funson86/frontend/web/
以访问应用程序前端。 - 使用URL
http://backend.yii2-advanced-funson86.domain
指向yii2-advanced-funson86/backend/web/
以访问应用程序后端。
使用yii2-auth
- 要检查是否显示在顶部菜单或侧边栏中,请将
'visible' => Yii::$app->user->can('readPost'),
添加到 top-menu.php 或 sidebar-menu.php。 - 要检查是否可以运行操作,请将
if(!Yii::$app->user->can('createPost')) throw new HttpException(401, 'No Auth');
添加到 XXXController.php 文件中的 actionIndex、actionCreate、actionUpdate。
注意
默认情况下将创建一个超级管理员用户,用户名为 admin
,密码为 qwe1234
,您可以使用此数据登录到应用程序前端和后端。
主题
- 应用程序后端基于 "Yii2 Advanced Backend" 模板。更多关于这个不错的模板的详细信息,您可以在这里找到 这里。
- 应用程序前端使用默认的 Yii2 Advanced 前端页面。
预览
相关
- Yii2-Gii : Gii for Yii2-advanced-funson86
- Yii2-Setting : Yii2的通用设置
- Yii2-Blog : Yii2的博客扩展
- Yii2-Cms : Yii2的Cms扩展