fbacks / yii2-api-template
Yii 2 REST API Template
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 2
Type:project
Requires
- php: >=5.4.0
- bizley/migration: ^3.5
- yiisoft/yii2: ^2.0.26
- yiisoft/yii2-bootstrap: ^2.0.10
- yiisoft/yii2-swiftmailer: ~2.0.0 || ~2.1.0
Requires (Dev)
- codeception/base: ^2.4.0
- codeception/codeception: ^2.5
- codeception/verify: ~1.2.0
- phpunit/phpunit: ~6.5.5
- yiisoft/yii2-debug: ^2.1.8
- yiisoft/yii2-faker: ~2.0.0
- yiisoft/yii2-gii: ^2.1.1
This package is auto-updated.
Last update: 2025-04-29 00:54:20 UTC
README
This is a a REST API template built using Yii2. This template use Yii2-Micro approach so it will be lightweight and easy to deploy.
The detailed documentation can be found at docs/README.md.
Requirements
The minimum requirement by this project template is that your Web server supports PHP 5.4.0. Also it is recommended that your php installation has the following modules enabled:
- intl: to use advanced parameters formatting in Yii::t()
To check the full requirements, please copy requirements.php
from the project root to api/web
folder, then navigate to the file from your web browser.
Installation
The preferred way to install this template is through composer using the following command:
composer create-project --prefer-dist fbacks/yii2-api-template [app_name]
DIRECTORY STRUCTURE
common
config/ contains shared configurations
mail/ contains view files for e-mails
models/ contains model classes used in both backend and frontend
tests/ contains tests for common classes
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
api
config/ contains api configurations
modules/ contains Web controller classes
runtime/ contains files generated during runtime
tests/ contains tests for api application
web/ contains the entry script and Web resources
vendor/ contains dependent 3rd-party packages
environments/ contains environment-based overrides