<?php

namespace app\components;

use yii\base\Component;


/**
 * Class that handles replies
 */
class Reply extends Component
{
    const STATE_PASS = 'pass';
    const STATE_FAIL = 'fail';

    private $ret = ['state' => null, 'message' => null, 'data' => null];

    public function json_reply($state, $message, $data){
        $ret = $this->ret;

        $ret['state'] = $state;
        $ret['message'] = $message;
        $ret['data'] = $data;

        return json_encode($ret);
    }
}

