prawee/yii2-app-advanced

Yii 2 高级应用程序模板

dev-master 2014-10-22 20:20 UTC

This package is auto-updated.

Last update: 2024-09-12 06:29:59 UTC


README

Yii 2 高级应用程序模板是一个用于开发复杂多层级Web应用的骨架Yii 2应用程序。

该模板包括三个层级:前端、后端和命令行,每个都是一个独立的Yii应用程序。

该模板旨在在团队开发环境中使用。它支持在不同环境中部署应用程序。

目录结构

common
    config/              contains shared configurations
    mail/                contains view files for e-mails
    models/              contains model classes used in both backend and frontend
console
    config/              contains console configurations
    controllers/         contains console controllers (commands)
    migrations/          contains database migrations
    models/              contains console-specific model classes
    runtime/             contains files generated during runtime
backend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains backend configurations
    controllers/         contains Web controller classes
    models/              contains backend-specific model classes
    runtime/             contains files generated during runtime
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
frontend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains frontend configurations
    controllers/         contains Web controller classes
    models/              contains frontend-specific model classes
    runtime/             contains files generated during runtime
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
    widgets/             contains frontend widgets
vendor/                  contains dependent 3rd-party packages
environments/            contains environment-based overrides
tests                    contains various tests for the advanced application
    codeception/         contains tests developed with Codeception PHP Testing Framework

需求

此应用程序模板的最小需求是您的Web服务器支持PHP 5.4.0。

安装

从存档文件安装

将从 yiiframework.com 下载的存档文件解压到Web根目录下的名为 advanced 的目录中。

然后按照“入门”部分给出的说明操作。

通过Composer安装

如果您没有 Composer,可以按照 getcomposer.org 上的说明进行安装。

然后可以使用以下命令安装应用程序:

LINUX
php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta3"
php composer.phar create-project --prefer-dist --stability=dev prawee/yii2-app-advanced advanced

WINDOWS
php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta3"
php composer.phar create-project --prefer-dist --stability=dev prawee/yii2-app-advanced advanced

通过Git克隆安装

git clone https://github.com/prawee/yii2-app-advance.git <your-projec-name>

入门

安装应用程序后,您需要执行以下步骤来初始化已安装的应用程序。您只需要为所有这些操作执行一次。

  1. 运行命令 init 以特定环境初始化应用程序。
  2. 创建一个新的数据库,并相应地调整 common/config/main-local.php 中的 components['db'] 配置。
  3. 使用控制台命令 yii migrate 应用迁移。这将创建应用程序运行所需的所有表。
  4. 设置Web服务器的文档根
  • 对于前端 /path/to/yii-application/frontend/web/,使用URL http://frontend/
  • 对于后端 /path/to/yii-application/backend/web/,使用URL http://backend/

要登录到应用程序,您需要先注册,可以使用任何电子邮件地址、用户名和密码。然后,您可以使用相同的电子邮件地址和密码随时登录到应用程序。'Prawee Wongsa' 'Prawee Wongsa'