Output functions

Basic functions for output and formatting.

Pro­ces­s(script, cursor)
Requires specific access granted, due to risk of producing unintended back doors. Such as running malicious scripts from user input.
con­sole­.a­sser­t(condition, message)
This function checks if a certain condition is false. If it is, outputs an error message and throws an exception with the message.
Set­Con­ten­tDis­posi­t­io­n(type, filename)
Tells the browser to download and save the returned result to a file with the specified name.
Html­ToXl­sx(filename, html)
Converts a html table to an Excel file (XLSX).
Html­ToPd­f(filename, html, usePrintCss)
Converts html to a PDF file using headless Chrome.
ba­se6­4(data)
Converts data to base64 encoded string.
Set­Mime(mime)
Allows user to set the mime type of a response.
Wri­te(text)
Outputs specified text to page content, same as write in javascript. Note that for API functions the output will not be returned to the user directly. It will written to the "output" buffer. Only if the "ContentDisposition" header is set the output will be returned.
Set­Resul­tCo­de(code)
Sets the HTTP result code for the response. This function is used to specify the HTTP status code that should be returned to the client.
Get­Hea­der(name)
Reads a header value from the request.
Set­Hea­der(name, value)
Sets a header value in the response.
Re­ques­t
Get information about the current request from the request object.
For­mat(value, format)
Formats a number or date into a string by given format.
For­mat­tin­g num­ber­s
Information about formatting numbers with the Docly format function.
HTML.­for­m­at(html)
Returns specified HTML string formatted as "prettified" indented HTML.
JSON.­for­m­at(json)
Outputs specified JSON string to "prettified" indented JSON.
Re­direc­t(url)
Redirects browser to specified url.
JSON.­par­s­e(json)
Parses a JSON string into an object.
JSON.st­r­in­gify(value)
Outputs specified text to your users log, same as in javascript. You can find your log here: #A
con­sole.­l­og(text)
Outputs specified text to your users log, same as in javascript. You can find your log here: https://docly.net/#A
Set­Cul­tur­e(culture)
Sets culture to use when formatting dates and numbers.
Text­ToHt­ml(text)
Converts input text to HTML (line breaks and encoding chars).
Ch­r(code, ...)
Returns character of specified number. Can take multiple values.