simple vue-based column editor

This commit is contained in:
2018-08-04 11:48:35 +02:00
parent 755c65a42d
commit e5a6527d18
22 changed files with 422 additions and 177 deletions
+24
View File
@@ -67,3 +67,27 @@ function vali($arr) {
}
return $result;
}
/**
* like old(), but decodes stringified json
*
* @param string $name
* @param object|array $default
* @return object|array
*/
function old_json($name, $default) {
$old = old($name, null);
if (is_string($old)) return json_decode($old);
return $default;
}
// Safe JSON funcs
function toJSON($object) {
return \GuzzleHttp\json_encode($object, JSON_UNESCAPED_SLASHES + JSON_UNESCAPED_UNICODE);
}
function fromJSON($object, $assoc=false) {
return \GuzzleHttp\json_decode($object, $assoc);
}