Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2-widgets2-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hrzg
yii2-widgets2-module
Commits
abd38606
Commit
abd38606
authored
Jul 13, 2016
by
Tobias Munk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added JSON formatting before saving record
parent
a2716f9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
WidgetTemplate.php
src/models/crud/WidgetTemplate.php
+10
-0
No files found.
src/models/crud/WidgetTemplate.php
View file @
abd38606
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment