Yii2 rest extension

Yii2 rest extension

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' => 'deerestRestAction',
        ],
    ];
}

To use url rule. Set in config

        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                [
                    'class' => 'deerestUrlRule',
                    'actions' => [
                        'post' => 'post/index',
                        
                    ],
                ],
            ],
        ],

Source

Tags:,

Add a Comment

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *