This is the uCentral base class containing all relevant helper functions. It is automatically instantiated and there is no global accessor.
Namespaces
Methods
-
staticuCentral.b(val){string}
-
Formats a given input value as uci boolean value.
Name Type Description val
* The value to format
Returns:
Type Description string Returns '1' if the given value is truish (not false
,null
,0
,0.0
or an empty string), or0
in all other cases. -
staticuCentral.s(str){string}
-
Formats a given input value as single quoted string, honouring uci specific escaping semantics.
Name Type Description str
* The string to format
Returns:
Type Description string Returns an empty string if the given input value is null
or an empty string. Returns the escaped and quoted string in all other cases. -
staticuCentral.tryinclude(path, scope)
-
Attempt to include a file, catching potential exceptions.
Try to include the given file path in a safe manner. The path is resolved relative to the path of the currently executed template and may only contain the character
A-Z
,a-z
,0-9
,_
,/
and-
as must contain a final.uc
file extension.Exception occuring while including the file are catched and a warning is emitted instead.
Name Type Description path
string Path of the file to include
scope
object The scope to pass to the include file