Components
Templating
Global Functions
Website
\Components\Website\Designs \Components\Website\Media \Components\Website\Pages \Components\Website\Pages\Forms \Components\Website\Posts \Components\Website\Posts\Categories
Customers
\Components\Customers\Contacts \Components\Customers\Contacts\Relationships \Components\Customers\Contacts\Relationships\Types \Components\Customers\Groups
Marketing
\Components\Marketing\EmailMarketing \Components\Marketing\Events \Components\Marketing\Events\Attendees \Components\Marketing\Events\Categories \Components\Marketing\Events\Locations
Commerce
\Components\Commerce\Carts \Components\Commerce\Carts\Current \Components\Commerce\Configuration\PaymentMethods \Components\Commerce\Configuration\ShippingMethods \Components\Commerce\Discounts \Components\Commerce\Products \Components\Commerce\Products\Brands \Components\Commerce\Products\Categories \Components\Commerce\Products\Inventory \Components\Commerce\Sales \Components\Commerce\Sales\Items \Components\Commerce\Sales\Receipts \Components\Commerce\Sales\Receipts\Allocations
Settings
\Components\Settings\Administrators \Components\Settings\CustomFields \Components\Settings\Domains
Other Apps
\Components\Website\Comments \Components\Commerce\Affiliates \Components\Commerce\Affiliates\Administrators \Components\Commerce\Affiliates\Commissions \Components\Commerce\Affiliates\Payments \Components\Commerce\RecurringSales \Components\Commerce\RecurringSales\StoredCards
Framework
\Framework\Caching \Framework\Data\Util \Framework\DOM\CurrentContext \Framework\HTML\Converters \Framework\HTTP\Cookies \Framework\HTTP\Redirection \Framework\HTTP\Request \Framework\HTTP\Session \Framework\HTTP\UserAgent \Framework\I18N\CompanyTypes \Framework\I18N\Countries \Framework\I18N\Languages \Framework\Network\GeoIP

Global Functions

The following functions can be called within HTML using [? funcname() ?] and from within PHP global scope. Most PHP functions are also available.
varDump()
Dumps / outputs the contents of a variable.

This function is used for debugging or to determine the contents of a variable.

If you have a data repeater that iterates over posts, you can show the contents the post via: [? varDump($post) ?]
Parameters
mixed
$mixedVariable Variable
string formatDate()
Reformats a date stamp to be human readable

[? formatDate($post['post_date']) ?]
Parameters
string|int
$strTime
string|null
$strDateFormat A custom date format to use. Default is '%d %b %Y'. Reference of format string is at https://www.php.net/manual/en/function.strftime.php
bool
$bNoRelative
Return
string
string formatDateTime()
Reformats a datetime stamp to be human readable

[? formatDateTime($post['post_date']) ?]
Parameters
string|int
$strTime The time to format. Can be a timestamp or a string time. Should be in UTC.
bool
$bSeparateWithBR Separate the date and time with a <br>.
string|null
$strDateFormat A custom date format to use. Default is '%d %b %Y'. Reference of format string is at https://www.php.net/manual/en/function.strftime.php
string|null
$strTimeFormat A custom time format to use. Default is '%l:%M%p'. Reference of format string is at https://www.php.net/manual/en/function.strftime.php
bool
$bNoTZ If true, don't convert to local time.
bool
$bNoRelative If true, don't show 'Today', 'Yesterday' for relative times
Return
string
string formatDuration()
Format the difference between two times, displaying as a number of hours, minutes and days as required. Parameters are assumed to be timestamps if integers, or assumed to be strtotime() compatable date strings.
Parameters
int|string
$mixedFrom
int|string|null
$mixedTo
Return
string
string formatTimeLeft()
Formats the number of time left in seconds

Eg - supplying 3600 will return '1 hour'.
Parameters
int
$iDifference Number
bool
$bShowSmaller
Return
string Number with commas every third digit
string formatNumber()
Formats a number with commas

[? formatNumber(1000, 2) ?] outputs 1,000.00
Parameters
int
$iNumber Number
Return
string Number with commas every third digit
string dbDate()
Formats date for queries
Parameters
string|int
$strDate
Return
string Date
string dbDateTime()
Formats datetime for queries
Parameters
string|int
$strDateTime UTC date
Return
string Date
float|null convertCurrency()
This function simply converts a price from one currency to another.

[? convertCurrency(100, 'AUD', 'USD') ?]
Parameters
float
$fPrice
string
$strCurrencyId
string
$strCurrencyConvertId
Return
float|null
string formatCurrency()
Returns a formatted currency

Where the system currency is AUD and we just want to show the price [?? formatCurrency(15) ??] would simply render "$15.00 AUD"

Where system currency is AUD, and we want to show Approx.
NZD amount converts from AUD to NZD. [?? formatCurrency(15, null, 'NZD') ??] would render "Approx. $19.25 NZD"

Where system currency is AUD, and we want to show Approx. NZD amount when the amount is in EUR
Converts from EUR to AUD, then AUD to NZD [?? formatCurrency(15, 'EUR', 'NZD') ??] would render "Approx. $35.26 NZD "

Where system currency is AUD, and we want to display NZD amount
No conversion, just rendering. [?? formatCurrency(15, 'NZD') ??] would render "$15.00 NZD"
Parameters
float
$fPrice The price to be rendered
string|null
$strCurrencyId The currency code of $fPrice
string|null
$strCurrencyConvertId The currency code to convert to
bool
$bDisplayCurrencyId Whether to display the currency label - e.g. AUD
bool
$bDisplaySymbol Whether to display the currency sign - e.g. $
Return
string
string makeHTMLValidName()
Constructs a valid HTML identifier for use in id="" and name="" attributes.

- Characters that are not alphanumeric are changed to underscores. - If the name starts with a number, and underscore will be prefixed to the name.
Parameters
string
$strName Potential HTML identifier
Return
string Valid HTML identifier
string|false makeHTTPRequest()
Make a HTTP request

This function can be used from within a PHP function to fetch data.

$str = makeHTTPRequest('https://www.googleapis.com/books/v1/volumes?q=' . htmlspecialchars($strQuery)); if ($str) { $arr = json_decode($str, true); }
Parameters
string
$strURL URL to request
array|null
$arrGET Query string parameters
array|null
$arrPOST POST body
array|null
$arrHeaders HTTP headers
array|null
$arrOtherOpts cURL opts
cURL|null
$pCurl Curl reference
Return
string|false Response body
println()
Prints text with a suffixed line break to the client
Parameters
string
$str Line