<?php

namespace Ciext\Controller;

abstract class AbstractJsonController extends \MX_Controller
{

    public function response($data = [])
    {
        $output = (!is_array($data)) ? (string) $data : json_encode($data);

        return $this->output->set_content_type('application/json')->set_output($output);
    }

}
