Working with json database fields

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
josejad
User
Posts: 117
Location: Spain

Working with json database fields

Post by josejad »

Hi everyone:

From this post (viewtopic.php?p=142237) I know PHPMaker supports JSON data types as string types.
But... how do you work with them? I mean, can I create a form to show/edit, etc... that data in a friendly way to the user?
Has anybody worked this way?

Thanks in advance


arbei
User
Posts: 9384

Post by arbei »

You may use Row_Rendered to set ViewValue, e.g.

$json = json_decode($this->MyField->DbValue);
$html = ...; // Format the JSON value as you like
$this->MyField->ViewValue = $html;

Post Reply