deesoft/yii2-rest

Yii2 rest extension

Installs: 13 205

Dependents: 3

Suggesters: 0

Security: 0

Stars: 4

Watchers: 4

Forks: 1

Open Issues: 0

Type:yii2-extension

dev-master / 1.x-dev 2015-09-08 08:53 UTC

This package is not auto-updated.

Last update: 2024-11-09 18:38:00 UTC


README

Yii2 rest extension

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require deesoft/yii2-rest "~1.0"

or add

"deesoft/yii2-rest": "~1.0"

to the require section of your composer.json file.

Usage

In controller

public function actions()
{
    return [
        'index' => [
            'class' => 'dee\rest\RestAction',
        ],
    ];
}

To use url rule. Set in config

        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                [
                    'class' => 'dee\rest\UrlRule',
                    'actions' => [
                        'post' => 'post/index',
                        
                    ],
                ],
            ],
        ],