class Jaxon

Traits

Constants

PROCESSING_EVENT

PROCESSING_EVENT_BEFORE

PROCESSING_EVENT_AFTER

PROCESSING_EVENT_INVALID

PROCESSING_EVENT_ERROR

METHOD_UNKNOWN

METHOD_GET

METHOD_POST

CALLABLE_OBJECT

USER_FUNCTION

BROWSER_EVENT

EVENT_HANDLER

FILE_UPLOAD

FORM_VALUES

INPUT_VALUE

CHECKED_VALUE

ELEMENT_INNERHTML

QUOTED_VALUE

BOOL_VALUE

NUMERIC_VALUE

JS_VALUE

PAGE_NUMBER

Methods

string
getVersion()

The current Jaxon version

void
setOption(string $sName, mixed $sValue)

Set the value of a config option

from Config
void
setOptions(array $aOptions, string $sKeys = '')

Set the values of an array of config options

from Config
mixed
getOption(string $sName, mixed $xDefault = null)

Get the value of a config option

from Config
bool
hasOption(string $sName)

Check the presence of a config option

from Config
array
getOptionNames(string $sPrefix)

Get the names of the options matching a given prefix

from Config
Config
newConfig()

Create a new the config manager

from Config
object
getPluginManager()

Get the plugin manager

from Manager
plugin(string $sName)

Get a registered response plugin

from Manager
object
getRequestManager()

Get the request manager

from Manager
object
getResponseManager()

Get the response manager

from Manager
void
addEventListener(EventListener $xEventListener)

Register an event listener.

from Manager
object
getResponse()

Get the Global Response object

from Manager
newResponse()

Create a new Jaxon response object

from Manager
string
trans(string $sText, array $aPlaceHolders = array(), string $sLanguage = null)

Get a translated string

void
setPaginationRenderer(object $xRenderer)

Set the pagination renderer

from Paginator
Paginator
paginator(integer $nItemsTotal, integer $nItemsPerPage, integer $nCurrentPage, Request $xRequest)

Get the pagination object for a Jaxon request

from Paginator
string
render(string $sTemplate, array $aVars = array())

Render a template

from Template
void
addViewNamespace(string $sNamespace, string $sDirectory, string $sExtension = '')

Add a namespace to the template system

from Template
__construct()

No description

void
useComposerAutoloader()

Set Jaxon to use the Composer autoloader

void
disableAutoload()

Disable Jaxon classes autoloading

mixed
register($sType, $xArgs)

Register request handlers, including functions, callable objects and events.

boolean
addClassDir(string $sDirectory, string|null $sNamespace = null, string $sSeparator = '.', array $aProtected = array())

Add a path to the class directories

void
registerClasses(array $aOptions = array())

Register callable objects from all class directories

void
registerClass(string $sClassName, array $aOptions = array(), boolean $bGetObject = false)

Register a callable object from one of the class directories

boolean
canProcessRequest()

Determine if a call is a jaxon request or a page load request

void
processRequest()

If this is a jaxon request, call the requested PHP function, build the response and send it back to the browser

void
sendResponse()

Send the response output back to the browser

void
sendHeaders()

Send the HTTP headers back to the browser

string
getOutput()

Get the response output

string
getScript(boolean $bIncludeJs = false, boolean $bIncludeCss = false)

Returns the Jaxon Javascript header and wrapper code to be printed into the page

void
printScript(boolean $bIncludeJs = false, boolean $bIncludeCss = false)

Print the jaxon Javascript header and wrapper code into your page

string
getJs()

Return the javascript header code and file includes

string
getCss()

Return the CSS header code and file includes

array
readPhpConfigFile(string $sConfigFile, string $sLibKey = '', string|null $sAppKey = null)

Read and set Jaxon options from a PHP config file

array
readYamlConfigFile(string $sConfigFile, string $sLibKey = '', string|null $sAppKey = null)

Read and set Jaxon options from a YAML config file

array
readJsonConfigFile(string $sConfigFile, string $sLibKey = '', string|null $sAppKey = null)

Read and set Jaxon options from a JSON config file

array
readConfigFile(string $sConfigFile, string $sLibKey = '', string|null $sAppKey = null)

Read and set Jaxon options from a config file

void
registerPlugin(Plugin $xPlugin, integer $nPriority = 1000)

Register a plugin

void
registerRequestPlugins()

Register the Jaxon request plugins

void
registerResponsePlugins()

Register the Jaxon response plugins

void
setPaginationDir(string $sDirectory)

Set a new directory for pagination templates

boolean
hasUploadedFiles()

Check if uploaded files are available

boolean
saveUploadedFiles()

Check uploaded files validity and move them to the user dir

array
getUploadedFiles()

Get the uploaded files

void
setUploadFileFilter(Closure $fFileFilter)

Filter uploaded file name

sentry()

Get the Sentry instance

armada()

Get the Armada instance

Details

at line line 179
string getVersion()

The current Jaxon version

Return Value

string

in Config at line line 37
void setOption(string $sName, mixed $sValue)

Set the value of a config option

Parameters

string $sName The option name
mixed $sValue The option value

Return Value

void

in Config at line line 50
void setOptions(array $aOptions, string $sKeys = '')

Set the values of an array of config options

Parameters

array $aOptions The config options
string $sKeys The keys of the options in the array

Return Value

void

in Config at line line 63
mixed getOption(string $sName, mixed $xDefault = null)

Get the value of a config option

Parameters

string $sName The option name
mixed $xDefault The default value, to be returned if the option is not defined

Return Value

mixed The option value, or null if the option is unknown

in Config at line line 75
bool hasOption(string $sName)

Check the presence of a config option

Parameters

string $sName The option name

Return Value

bool True if the option exists, and false if not

in Config at line line 87
array getOptionNames(string $sPrefix)

Get the names of the options matching a given prefix

Parameters

string $sPrefix The prefix to match

Return Value

array The options matching the prefix

in Config at line line 97
Config newConfig()

Create a new the config manager

Return Value

Config The config manager

in Manager at line line 27
object getPluginManager()

Get the plugin manager

Return Value

object The plugin manager

in Manager at line line 39
Response plugin(string $sName)

Get a registered response plugin

Parameters

string $sName The name of the plugin

Return Value

Response

in Manager at line line 49
object getRequestManager()

Get the request manager

Return Value

object The request manager

in Manager at line line 59
object getResponseManager()

Get the response manager

Return Value

object The response manager

in Manager at line line 69
void addEventListener(EventListener $xEventListener)

Register an event listener.

Parameters

EventListener $xEventListener

Return Value

void

in Manager at line line 79
object getResponse()

Get the Global Response object

Return Value

object The Global Response object

in Manager at line line 89
Response newResponse()

Create a new Jaxon response object

Return Value

Response The new Jaxon response object

in Translator at line line 30
string trans(string $sText, array $aPlaceHolders = array(), string $sLanguage = null)

Get a translated string

Parameters

string $sText The key of the translated string
array $aPlaceHolders The placeholders of the translated string
string $sLanguage The language of the translated string

Return Value

string The translated string

in Paginator at line line 26
void setPaginationRenderer(object $xRenderer)

Set the pagination renderer

Parameters

object $xRenderer The pagination renderer

Return Value

void

in Paginator at line line 41
Paginator paginator(integer $nItemsTotal, integer $nItemsPerPage, integer $nCurrentPage, Request $xRequest)

Get the pagination object for a Jaxon request

Parameters

integer $nItemsTotal The total number of items
integer $nItemsPerPage The number of items per page page
integer $nCurrentPage The current page
Request $xRequest A request to a Jaxon function

Return Value

Paginator The paginator instance

in Template at line line 27
string render(string $sTemplate, array $aVars = array())

Render a template

Parameters

string $sTemplate The name of template to be rendered
array $aVars The template vars

Return Value

string The template content

in Template at line line 41
void addViewNamespace(string $sNamespace, string $sDirectory, string $sExtension = '')

Add a namespace to the template system

Parameters

string $sNamespace The namespace name
string $sDirectory The namespace directory
string $sExtension The extension to append to template names

Return Value

void

at line line 111
__construct()

at line line 159
void useComposerAutoloader()

Set Jaxon to use the Composer autoloader

Return Value

void

at line line 169
void disableAutoload()

Disable Jaxon classes autoloading

Return Value

void

at line line 207
mixed register($sType, $xArgs)

Register request handlers, including functions, callable objects and events.

New plugins can be added that support additional registration methods and request processors.

Parameters

$sType
$xArgs

Return Value

mixed

at line line 242
boolean addClassDir(string $sDirectory, string|null $sNamespace = null, string $sSeparator = '.', array $aProtected = array())

Add a path to the class directories

Parameters

string $sDirectory The path to the directory
string|null $sNamespace The associated namespace
string $sSeparator The character to use as separator in javascript class names
array $aProtected The functions that are not to be exported

Return Value

boolean

at line line 254
void registerClasses(array $aOptions = array())

Register callable objects from all class directories

Parameters

array $aOptions The options to register the classes with

Return Value

void

at line line 271
void registerClass(string $sClassName, array $aOptions = array(), boolean $bGetObject = false)

Register a callable object from one of the class directories

The class name can be dot, slash or anti-slash separated. If the $bGetObject parameter is set to true, the registered instance of the class is returned.

Parameters

string $sClassName The name of the class to register
array $aOptions The options to register the class with
boolean $bGetObject Return the registered instance of the class

Return Value

void

at line line 282
boolean canProcessRequest()

Determine if a call is a jaxon request or a page load request

Return Value

boolean

at line line 301
void processRequest()

If this is a jaxon request, call the requested PHP function, build the response and send it back to the browser

This is the main server side engine for Jaxon. It handles all the incoming requests, including the firing of events and handling of the response. If your RequestURI is the same as your web page, then this function should be called before ANY headers or HTML is output from your script.

This function may exit after the request is processed, if the 'core.process.exit' option is set to true.

Return Value

void

See also

canProcessRequest>

at line line 404
void sendResponse()

Send the response output back to the browser

Return Value

void

at line line 414
void sendHeaders()

Send the HTTP headers back to the browser

Return Value

void

at line line 424
string getOutput()

Get the response output

Return Value

string

at line line 440
string getScript(boolean $bIncludeJs = false, boolean $bIncludeCss = false)

Returns the Jaxon Javascript header and wrapper code to be printed into the page

The javascript code returned by this function is dependent on the plugins that are included and the functions and classes that are registered.

Parameters

boolean $bIncludeJs Also get the JS files
boolean $bIncludeCss Also get the CSS files

Return Value

string

at line line 470
void printScript(boolean $bIncludeJs = false, boolean $bIncludeCss = false)

Print the jaxon Javascript header and wrapper code into your page

The javascript code returned by this function is dependent on the plugins that are included and the functions and classes that are registered.

Parameters

boolean $bIncludeJs Also print the JS files
boolean $bIncludeCss Also print the CSS files

Return Value

void

at line line 480
string getJs()

Return the javascript header code and file includes

Return Value

string

at line line 490
string getCss()

Return the CSS header code and file includes

Return Value

string

at line line 504
array readPhpConfigFile(string $sConfigFile, string $sLibKey = '', string|null $sAppKey = null)

Read and set Jaxon options from a PHP config file

Parameters

string $sConfigFile The full path to the config file
string $sLibKey The key of the library options in the file
string|null $sAppKey The key of the application options in the file

Return Value

array

at line line 518
array readYamlConfigFile(string $sConfigFile, string $sLibKey = '', string|null $sAppKey = null)

Read and set Jaxon options from a YAML config file

Parameters

string $sConfigFile The full path to the config file
string $sLibKey The key of the library options in the file
string|null $sAppKey The key of the application options in the file

Return Value

array

at line line 532
array readJsonConfigFile(string $sConfigFile, string $sLibKey = '', string|null $sAppKey = null)

Read and set Jaxon options from a JSON config file

Parameters

string $sConfigFile The full path to the config file
string $sLibKey The key of the library options in the file
string|null $sAppKey The key of the application options in the file

Return Value

array

at line line 546
array readConfigFile(string $sConfigFile, string $sLibKey = '', string|null $sAppKey = null)

Read and set Jaxon options from a config file

Parameters

string $sConfigFile The full path to the config file
string $sLibKey The key of the library options in the file
string|null $sAppKey The key of the application options in the file

Return Value

array

at line line 577
void registerPlugin(Plugin $xPlugin, integer $nPriority = 1000)

Register a plugin

Below is a table for priorities and their description: - 0 thru 999: Plugins that are part of or extensions to the jaxon core - 1000 thru 8999: User created plugins, typically, these plugins don't care about order - 9000 thru 9999: Plugins that generally need to be last or near the end of the plugin list

Parameters

Plugin $xPlugin An instance of a plugin
integer $nPriority The plugin priority, used to order the plugins

Return Value

void

at line line 587
void registerRequestPlugins()

Register the Jaxon request plugins

Return Value

void

at line line 600
void registerResponsePlugins()

Register the Jaxon response plugins

Return Value

void

at line line 613
void setPaginationDir(string $sDirectory)

Set a new directory for pagination templates

Parameters

string $sDirectory The directory path

Return Value

void

at line line 623
boolean hasUploadedFiles()

Check if uploaded files are available

Return Value

boolean

at line line 637
boolean saveUploadedFiles()

Check uploaded files validity and move them to the user dir

Return Value

boolean

at line line 673
array getUploadedFiles()

Get the uploaded files

Return Value

array

at line line 689
void setUploadFileFilter(Closure $fFileFilter)

Filter uploaded file name

Parameters

Closure $fFileFilter The closure which filters filenames

Return Value

void

at line line 703
Sentry sentry()

Get the Sentry instance

Return Value

Sentry

at line line 713
Armada armada()

Get the Armada instance

Return Value

Armada