Namespace: controllers[]

NA#controllers[]

Contain all functions of controllers both common and specific.
Source:

Example

// Functions for common controller if common `controller` value is "common.json".
NA.controllers["common.json"].setModules(...);
NA.controllers["common.json"].setSessions(...);
NA.controllers["common.json"].setSockets(...);
NA.controllers["common.json"].setConfigurations(...);
NA.controllers["common.json"].setRoutes(...);
NA.controllers["common.json"].changeVariations(...);
NA.controllers["common.json"].changeDom(...);

// Functions for specific controller if a route `controller` value is "index.json".
NA.controllers["index.json"].setSockets(...);
NA.controllers["index.json"].changeVariations(...);
NA.controllers["index.json"].changeDom(...);

Methods

(static) changeDom(callback, locals, response, request)

Define this function for intercept DOM and modify it with jQuery for example. Both `common` and `specific` controller.
Parameters:
Name Type Description
callback changeDom~callback Next steps after configuration is done.
locals Object Local variables for the current page.
Properties
Name Type Description
dom string DOM of current page.
response Object Initial response.
request Object Initial request.
Source:

(static) changeVariations(callback, locals, response, request)

Define this function for intercept Variation object and modify it. Both `common` and `specific` controller.
Parameters:
Name Type Description
callback changeVariations~callback Next steps after configuration is done.
locals Object Local variables object of current page.
response Object Initial response.
request Object Initial request.
Source:

(static) setConfigurations(next)

Define this function for configure all modules of your application. Only for `common` controller file.
Parameters:
Name Type Description
next NA~callback Next steps after configuration is done.
Source:

(static) setModules()

Define this function for adding npm module into `NA.modules` of application. Only for `common` controller file.
Source:

(static) setRoutes(next)

Set all routes before the index was started.
This:
Parameters:
Name Type Description
next NA~callback Next steps after routes are setted.
Source:

(static) setSessions(next)

Define this function for configure sessions of application. Only for `common` controller file.
Parameters:
Name Type Description
next NA~callback Next steps after session is setted.
Source:

(static) setSockets()

Define this function for set WebSockets from both `common` and `specific` controller.
Source: