12 public function __construct($context, $params, $encode_fnc = null)
14 if (!\
Entity\Config::getConfig(null,
"restfullEnabled",
false))
15 throw new \Exception\Error404();
16 parent::__construct($context, $params);
17 if ($encode_fnc === null)
18 $encode_fnc = array(
"method" => json_encode,
"mime" =>
"application/json");
19 $this->encode_fnc = $encode_fnc;
25 header(
"Content-Type: {$this->encode_fnc["mime
"]}");
26 echo $this->encode_fnc[
"method"]($this->run());
30 abstract public function run();