Controllerクラスの出力を以下のように、何らかの連想配列をjson_encodeで送ります。
Content-Typeの指定方法を忘れるのでメモです。
public function action_hoge()
{
$hoge = array(...); //何らかの連想配列
$this->request->headers['Content-Type'] = 'application/json';
$this->request->response = json_encode($hoge->get_entries());
}
追記: Kohana3.1.xの場合
request / responseクラスが別れたので記述が変更になります。public function action_hoge()
{
$hoge = array(...); //何らかの連想配列
$this->response->headers('Content-Type', 'application/json');
$this->response->body(json_encode($data));
}