Skip to content

Extra actions, controller and helpers for rest in yii2

License

Notifications You must be signed in to change notification settings

Faryshta/yii2-rest-extras

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tecnocen Yii2 Bootstrap Year Calendar

Latest Stable Version Total Downloads Latest Unstable Version License

Extra utilities for REST in yii2

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist "faryshta/yii2-rest-extras:*"

or add

"faryshta/yii2-rest-extras": "*"

to the require section of your composer.json file.

Usage

Options Action

The options action class faryshta\rest\actions\Options returns the same headers as yii\rest\ActionOptions and it also returns a body with a deconstructed description of the model.

This action is meant to be used in the actions() method on a controller

use faryshta\rest\actions\Options;

public function actions()
{
    return [
        'options' => [
            'class' => Options::className(),
            'modelClas' => $this->modelClass,
            'extraData' => function ($model) {
                // array with the extra data you want to return.
            },
        ]
    ]
}

License

The BSD License (BSD). Please see License File for more information.

About

Extra actions, controller and helpers for rest in yii2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages