Fork me on GitHub

Setting up the library


The options of the Jaxon library can be defined in a configuration file, which is loaded when bootstrapping the application, with the above call.

// Configuration
jaxon()->app()->setup('/path/to/config.php');

The configuration file can be in one of the php, json or yaml formats, and has two main sections, identified with the app andlib keywords.

The lib section contains the configuration options of the Ajax implementation in the library, and its plugins.

The app section contains the configuration options for application level features like classes and functions registration, dialog libraries, views, annotations, and packages. The options available in this section are documented together with their respective features.

The values of the configuration options in the lib section are changed with calls to jaxon()->setOption($name, $value) or jaxon()->setOptions($values), where $values is an array. They are read with a call to jaxon()->getOption($name).

Similarily, the values of the configuration options in the app section are changed with jaxon()->setAppOption($name, $value) or jaxon()->setAppOptions($values), and read with jaxon()->getAppOption($name).

Deprecated function

The Jaxon library also allows to load the configuration options of its Ajax implementation (the content of the lib section) with the following call.

jaxon()->config()->load($phpFilePath);

Using this function is now discouraged, since it duplicates the above setup() function.

The configuration options

These options are those of the Jaxon library. Its plugins can require additional options.

Name Type Description
core.version string The version number of the library
core.language string The language of the library
core.encoding string The character encoding to use
core.decode_utf8 boolean Whether to decode UTF8 Jaxon function parameters
core.prefix.function string The prefix to add to the names of exported javascript functions
core.prefix.class string The prefix to add to the names of the exported javascript classes
core.request.uri string The URL where all Jaxon requests are sent
core.request.mode string The query mode. Can be "asynchronous" or "synchronous"
core.request.method string The query method. Can be "POST" or "GET"
core.request.csrf_meta string The name of the HTML meta header for the CSRF token
core.process.clean boolean Whether to clean the buffer after the processing of a request
core.process.exit boolean Whether to call the exit() function after the processing of a request
core.process.timeout integer
core.error.handle boolean Whether to handle error
core.error.log_file string The path of the error log file
core.debug.on boolean Whether to enable debug mode
core.debug.verbose boolean Whether to enable verbose debug mode
core.debug.output_id string The id of the javascript debug output
js.lib.uri string The link to the Jaxon javascript libraries
js.lib.queue_size integer The max number of commands in a single answer
js.lib.show_cursor boolean Whether to display a cursor
js.lib.show_status boolean Whether to display the status of the request
js.app.uri string The link to the javascript files generated by Jaxon
js.app.dir string The directory that contains the javascript files generated by Jaxon
js.app.export boolean Whether to create a javascript file containing the code generated by Jaxon
js.app.minify boolean Whether to minify the file generated by Jaxon
js.app.file string The name of the javascript file, without the extension
js.app.options string The options to add to the javascript tag in the generated HTML code
core.upload.enabled boolean Whether to enable the upload feature