Helper classes to create RESTful API in yii2.

Installs: 634

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

v0.0.8 2019-08-07 14:46 UTC

This package is auto-updated.

Last update: 2024-04-08 01:17:00 UTC


README

Helper classes to create RESTful API in yii2.

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require umbalaconmeogia/yii2-api "@dev"

or add

"umbalaconmeogia/yii2-api": "@dev"

to the require section of your composer.json file and run composer update.

Add SubSystemUser

For client system that use SubSystemUser, you should run migration to create sub_system_user table.

Configuring migration path.

'migrate' => [
	'class' => 'yii\console\controllers\MigrateController',
	'migrationPath' => [
		'@console/migrations',
		'@vendor/umbalaconmeogia/yii2-api/src/migrations',
	],
],

Namespaced Migrations

For yii2 advanced template, add to console/config/main.php

'controllerMap' => [
	'migrate' => [
		'class' => 'yii\console\controllers\MigrateController',
		'migrationPath' => null, // disable non-namespaced migrations if app\migrations is listed below
		'migrationNamespaces' => [
			'console\migrations', // Common migrations for the whole application
			'umbalaconmeogia\yii2api\migrations', // Migrations for the specific extension
		],
	],
],

For yii2 basic template, add to app/config/web.php

'controllerMap' => [
	'migrate' => [
		'class' => 'yii\console\controllers\MigrateController',
		'migrationPath' => null, // disable non-namespaced migrations if app\migrations is listed below
		'migrationNamespaces' => [
			'app\migrations', // Common migrations for the whole application
			'umbalaconmeogia\yii2api\migrations', // Migrations for the specific extension
		],
	],
],

License

yii2-api is released under the MIT License. See the bundled LICENSE for details.