Binds a callback functio to a System Event
static void
bindSysEvent
( $name, $callback)
Binds an Array or a PDO result set to a template
static string
bindTemplate
( $rows, $options)
Converts the given date to a RaxanDateTime object
Returns or sets configuration values
static mixed
config
([ $key = null], [ $value = null])
Creates and returns a PDO connection to a database.
If connection failed then error is logged to the log file or debug screen. Sensitive data will be removed.
static
RaxanPDO
connect
(
mixed $dsn, [
string $user =
null], [
string $password =
null], [
mixed $attribs =
null])
-
mixed
$dsn: Acceptts string or array
-
string
$user: Optional user name
-
string
$password: Optional password
-
mixed
$attribs: Optional PDO error mode or array of attributes. Set to TRUE to enable PDO error mode
Returns current web page url relative to the document root
static string
currentURL
()
Get and/or set a named data value for the current Session
static mixed
&data
([string $name = null], [mixed $value = null], [boolean $setValueIfNotIsSet = false])
-
string
$name
-
mixed
$value
-
boolean
$setValueIfNotIsSet
Sets or returns a named data value for the current Session based on the specified data bank id
static mixed
&dataBank
( $bankId, [ $name = null], [ $value = null], [ $setValueIfNotIsSet = false])
-
$bankId
-
$name
-
$value
-
$setValueIfNotIsSet
Returns a new instanace of RaxanDataSanitizer. Use the sanitizer to sanitize array or input values
-
array
$array: Array containing values to be sanitized
-
string
$charset
Returns or sets the session data storage handler
Returns the session data storage id
static string
dataStorageId
()
Sends debugging information to client
static boolean
debug
(string $txt)
-
string
$txt: Debug value. Set to TRUE or FALSE to enable or disable debugging
Returns debug output as text
static string
debugOutut
()
Converts multi-line text into a single-line JS string
static string
escapeText
( $txt)
Set or get flash value. Flash provides a way to pass temporary objects/values
between pages and views. The flash value is removed after it has been retrieved
static string
flash
(string $name, [mixed $value = null])
-
string
$name
-
mixed
$value
Returns a shared instanace of RaxanDataSanitizer with direct input enabled. Used internally
Resamples (convert/resize) an image file. You can specify a new width, height and type
static boolean
imageResample
(string $file, int $w, int $h, [string $type = null])
-
string
$file: Image path and file name
-
int
$w: Width
-
int
$h: Height
-
string
$type: Supported image types: gif,png,jpg,bmp,xbmp,wbmp. Defaults to jpg
Returns an array containing the width, height and type for the image file
static array
imageSize
(string $file)
-
string
$file: Image path and file name
Converts a CSV file into an 2D array. The first row of the CSV file must contain the column names
static array
importCSV
( $file, [ $delimiter = ','], [ $enclosure = '"'], [ $escape = '\\'], [ $terminator = "\n"])
-
$file
-
$delimiter
-
$enclosure
-
$escape
-
$terminator
Initialize the system and load config options
static boolean
init
()
Initialize session data storage handler
static void
initDataStorage
()
Initialize JSON support
static void
initJSON
()
Encode/Decode JSON Strings
static string
JSON
(string $mode, mixed $value, [boolean $assoc = false])
-
string
$mode: Set to encode or decode
-
mixed
$value: Value to be encoded or decoded
-
boolean
$assoc: Set to true to return objects as associative arrays
Loads a config file
static void
loadConfig
( $file)
Loads a language file based on locale settings
usage: loadLangFile($fl1,$fl2,$fl3,...)
static boolean
loadLangFile
( $fl)
Loads a plugin from the plugins folder.
Usage: <p>Raxan::loadPlugin($name,$extrn)</p>
static mixed
loadPlugin
(string $name, [boolean $extrn = false])
-
string
$name: Name of plugin file without the .php extension
-
boolean
$extrn: Set to true if plugin will be loaded from a folder that's not relative to {plugins.path}
Loads a widget from the widgets folder.
static boolean
loadWidget
(string $name, [boolean $extrn = false])
-
string
$name: Name of widget file without the .php extension
-
boolean
$extrn: Set to true if widget will be loaded from a folder that's not relative to {widgets.path}
Returns locale settings based on the the site.locale config option
static string
locale
([ $key = null], [ $arg1 = null], [ $arg2 = null], [ $arg3 = null], [ $arg4 = null], [ $arg5 = null], [ $arg6 = null])
-
$key
-
$arg1
-
$arg2
-
$arg3
-
$arg4
-
$arg5
-
$arg6
Adds an entry to the log file
static boolean
log
( $var, [string $level = null], [string $label = null], string $str)
-
string
$str
-
string
$level: Optional tag to be assocciated with the log entry. E.g. ERROR, WARNING, INFO, etc
-
string
$label: Optional.
-
$var
Returns the URL for a file or folder path within the site
static string
mapSitePathToUrl
(string $pth)
-
string
$pth: The path to the file or folder
Generate page numbers based . The $option values are similar to that of bindTemplate
static string
paginate
( $maxPage, $page, [ $options = null])
Redirect client to the specified url
static void
redirectTo
(string $url, [boolean $useJavaScript = false])
-
string
$url: page url
-
boolean
$useJavaScript: Optional. Enable page redirection using client-side JavaScript
Redirect to new page view
static void
redirectToView
(string $view, [string $url = null], [boolean $useJavaScript = false])
-
string
$view: View mode
-
string
$url: Optional page url
-
boolean
$useJavaScript: Optional. Enable page redirection using client-side JavaScript
Remove session data
static void
removeData
( $name)
Remove named data from a data bank within the current session
static void
removeDataBank
( $bankId, [ $name = null])
Sends an error page to the web browser
static void
sendError
( $msg, [ $code = null])
Sets the base path for the framework
static void
setBasePath
( $pth)
Sets the locale and/or lang code
static boolean
setLocale
( $code, [ $lang = null])
Returns an instance of Raxan
static
Raxan
singleton
()
Start/Stop Timer Functions
static void
startTimer
()
static void
stopTimer
([ $time = null])
Throws an exception for missing or invalid callback
static void
throwCallbackException
( $fn)
Triggers a System Event
static mixed
triggerSysEvent
(string $name, [mixed $args = null])
-
string
$name: Event type/name
-
mixed
$args: Optional event argument