TiqHelper
in package
Table of Contents
Methods
- httpNoCacheResponse() : void
- httpResponse() : void
- Helper function to return HTTP response
- isStringJsonObject() : bool
- Check if a string is a valid JSON object
- parseSQLError() : array<string|int, mixed>
- Parse SQL Error Message
- renderLoader() : bool|string
- Render TIQ Loading Bulb
Methods
httpNoCacheResponse()
public
static httpNoCacheResponse() : void
httpResponse()
Helper function to return HTTP response
public
static httpResponse(mixed $data[, bool $toJson = true ][, bool $noCache = true ][, int $statusCode = 200 ]) : void
Parameters
- $data : mixed
-
- Data to return
- $toJson : bool = true
-
- Convert to JSON
- $noCache : bool = true
-
- No cache header
- $statusCode : int = 200
-
- HTTP Status Code
isStringJsonObject()
Check if a string is a valid JSON object
public
static isStringJsonObject(string $string) : bool
Parameters
- $string : string
-
- String to check
Return values
bool —- True if string is a valid JSON object
parseSQLError()
Parse SQL Error Message
public
static parseSQLError(string $message[, bool $includeSeparators = false ]) : array<string|int, mixed>
Parameters
- $message : string
-
-
Error message
-
- $includeSeparators : bool = false
-
- Include separators in parse result or not
Return values
array<string|int, mixed> —Parse result array
renderLoader()
Render TIQ Loading Bulb
public
static renderLoader([bool $raw = false ]) : bool|string
Parameters
- $raw : bool = false