public static function InstapageCmsPluginHelper::formatJsonMessage in Instapage plugin 7.3
Same name and namespace in other branches
- 8.3 core/InstapageCmsPluginHelper.php \InstapageCmsPluginHelper::formatJsonMessage()
Encodes a message as a JSON object.
Parameters
string $text Text of the message:
string $status. Status of a message. Typically 'OK' or 'ERROR'.:
Return value
string encoded JSON message object.
1 call to InstapageCmsPluginHelper::formatJsonMessage()
- InstapageCmsPluginPageModel::publishPage in core/
models/ InstapageCmsPluginPageModel.php - Sends a request to publish a page in Instapage app.
File
- core/
InstapageCmsPluginHelper.php, line 325
Class
- InstapageCmsPluginHelper
- Helper containing commonly used static functions.
Code
public static function formatJsonMessage($text, $status = 'OK') {
self::writeDiagnostics($text, 'Message');
return json_encode((object) array(
'status' => $status,
'message' => $text,
));
}