diff --git a/controller/Controller.php b/controller/Controller.php index 77ce9fa..9c3aa81 100644 --- a/controller/Controller.php +++ b/controller/Controller.php @@ -10,6 +10,16 @@ Class Controller { if (!empty(FSC::$app['config']['default_layout'])) { $this->layout = FSC::$app['config']['default_layout']; } + + //json body auto serialization to $_POST + try { + $json = file_get_contents('php://input'); + $jsonData = json_decode($json, true); + + if (!empty($jsonData)) { + $_POST = array_merge($_POST, $jsonData); + } + }catch(Exception $e) {} } function __destruct() {