This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/app/Controllers/Controller.php

28 lines
505 B
PHP
Raw Normal View History

2016-02-15 21:20:46 +00:00
<?php
/**
* Holds the base controller.
*
* @package Sakura
*/
namespace Sakura\Controllers;
/**
* Base controller (which other controllers should extend on).
*
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
class Controller
{
2016-03-30 21:30:15 +00:00
public function json($object)
2016-03-30 09:09:58 +00:00
{
2016-03-30 21:30:15 +00:00
header('Content-Type: application/json; charset=utf-8');
2016-03-30 09:09:58 +00:00
return json_encode(
$object,
JSON_FORCE_OBJECT | JSON_NUMERIC_CHECK | JSON_BIGINT_AS_STRING
);
}
2016-02-15 21:20:46 +00:00
}