getMessage(); $error['code'] = $e->getCode(); $error['file'] = $e->getFile(); $error['line'] = $e->getLine(); $error['trace'] = array_slice(explode('#', $e->getTraceAsString()), 1, -1); return self::toString($error, false); } /** * Retun JsonResult with success status * * @return string Returns json string. */ public static function ok(){ return self::toString(NULL);} /** * Retun JsonResult with failure status * * @return string Returns json string. */ public static function fail(){ return self::toString(NULL,false);} public static function status($status){ return $status ? self::ok() : self::fail();} }