1234567891011121314151617181920212223242526272829303132 |
- <?php
-
- namespace Luticate\Utils;
-
-
- class LuOutputFormatter
- {
- public static $APP_VERSION = 1.0;
-
- public static function getResponse()
- {
- return array(
- "Version" => self::$APP_VERSION,
- "Data" => null,
- "Message" => null
- );
- }
-
- public static function formatSuccess($data)
- {
- $r = self::getResponse();
- $r["Data"] = $data;
- return $r;
- }
-
- public static function formatError($code, $message)
- {
- $r = self::getResponse();
- $r["Message"] = $message;
- return $r;
- }
- }
|