rex-it/yii2-rest-starter-kit

Yii 2 Rest 应用程序骨架。

v0.0-beta 2016-08-15 11:58 UTC

This package is not auto-updated.

Last update: 2024-09-20 19:09:34 UTC


README

安装

克隆或

composer create-project --prefer-dist --stability=dev rex-it/yii2-rest-starter-kit
  1. 将 .env.dist 复制为 .env 并输入必要的数据。

  2. 运行命令:php yii app/setup(这将创建新用户)

  3. 享受!

结构

标准带版本控制的 API 模块模板。

路由存储在 config/routes.php 中

自定义 ErrorHandler

支持多语言和限制到两种格式的 ContentNegotiator:json, xml

V1 组件实现了 Rest Controller 和 Active Controller 的父类,并在 behaviors 中要求授权。