betsuno/yii2-json-behavior

JSON behavior for Yii2 framework

0.1.1 2018-02-20 13:27 UTC

This package is auto-updated.

Last update: 2024-05-06 23:09:18 UTC


README

Installation

Run command in shell

> php composer.phar require "betsuno/yii2-json-behavior"

or add

"betsuno/yii2-json-behavior": "*"

in the require section of the composer.json file in your project

Usage

use yii2/behaviors/JsonBehavior
...
class YourClass extendes Model
{
    ...
    public function behaviors()
    {
        return [
            JsonBehavior::register('propertyName'),
        ];
    }
    ...
}