Commit abd38606 authored by Tobias Munk's avatar Tobias Munk

added JSON formatting before saving record

parent a2716f9c
......@@ -46,4 +46,14 @@ class WidgetTemplate extends BaseWidgetTemplate
return Json::decode($json->scalar);
}
/**
* Format json_schema before saving to database
* @param string $json_schema
*/
public function beforeSave($insert) {
$data = json_decode($this->json_schema);
$this->json_schema = json_encode($data, JSON_PRETTY_PRINT);
return parent::beforeSave($insert);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment