Namespace: apps

BX. apps

Namespace BX.apps holds an instance of the AppManager class.

Source:

Methods

(static) add (config)

Saves the configuration of a new application. Application instance will be created on the first request.
Application is a class of 'brixy.mvc.Application' or config.application.
If config.autorun is passed, application runs immediately with it as the first request.
Application with the specified config.id is added only once.

Parameters:
Name Type Description
config Object

Configuration object is used to create application.

Throws:
  • Exception on error.

Source:

(static) exists (id) → {boolean}

Checks if there exists an application with the given id.

Parameters:
Name Type Description
id *

Application ID.

Returns:
  • boolean
Source:

(static) get (id) → {Object|null}

Returns an application with the given id.

Parameters:
Name Type Description
id *

Application ID.

Returns:
  • Object | null
Source:

(static) processEvent (event, data)

Processes the event. Passes the event to each application that listens it.

Parameters:
Name Type Description
event string

Event name.

data Object

Application will pass the data to the event handler. (optional)

Source:

(static) processRequest (id, request)

Passes the request to the application of the ID. If the ID doesn't exist, does nothing.

Parameters:
Name Type Description
id *

Application ID.

request string | Object

Request string or route object.

Throws:
  • Exception on error.

Source: