MVC Namespace


Classes


BaseController

constructor

With the help of this method you can create a new instance of BaseController.

Signature

constructor(void) : Object|BaseController

Returns

  • Object, BaseController
    • A new instance of BaseController

configure

Configure the controller.

Signature

configure(Object app, Object server, Function callback) : void

Parameters

  • app
    • The application object
    • Type: Object
  • server
    • Server object
    • Type: Object
  • callback
    • Function to call on finish
    • Type: Function

view

Build a view path by a given file.

Signature

view(String file) : String

Parameters

  • file
    • Name of the view file
    • Type: String

Returns

  • String
    • The return value is not further described

Build a link to an action.

Signature

link(String action, Object params, [String absoluteUrl]) : String

Parameters

  • action
    • Name of the action to link to
    • Type: String
  • params
    • Parameters object
    • Type: Object
  • [absoluteUrl]
    • If given, it will be prefixed
    • Type: String

Returns

  • String
    • The return value is not further described


ControllerLoader

constructor

With the help of this method you can create a new instance of ControllerLoader.

Signature

constructor(void) : Object|ControllerLoader

Returns

  • Object, ControllerLoader
    • A new instance of ControllerLoader

getRelativePath

Gets the relative path of a controller.

Signature

getRelativePath(String path, String module) : String

Parameters

  • path
    • The full path to the controller file
    • Type: String
  • module
    • The name of the controller module
    • Type: String

Returns

  • String
    • The return value is not further described

getCanonicalPath

Gets the canonical path to store the controller.

Signature

getCanonicalPath(String path, String controller, String module) : String

Parameters

  • path
    • The full path to the controller file
    • Type: String
  • controller
    • Name of the controller
    • Type: String
  • module
    • The name of the controller module
    • Type: String

Returns

  • String
    • The return value is not further described

getBasePath

Gets the base path for a given controller.

Signature

getBasePath(Object controller, String path, String module) : String

Parameters

  • controller
    • The controller object
    • Type: Object
  • path
    • The full path to the controller file
    • Type: String
  • module
    • The name of the controller module
    • Type: String

Returns

  • String
    • The complete base path of the controller

prepareControllerActions

Prepare actions for a given controller object.

Signature

prepareControllerActions(Object controller, Function callback) : void

Parameters

  • controller
    • Controller to prepare
    • Type: Object
  • callback
    • Function to call on finish
    • Type: Function

loadController

Load a given controller.

Signature

loadController(String path, String name, String module, Function callback) : void

Parameters

  • path
    • Path to the controller to load
    • Type: String
  • name
    • Name the controller
    • Type: String
  • module
    • Name of the module to add the controller
    • Type: String
  • callback
    • Function to call on finish
    • Type: Function

load

Load routes for given modules.

Signature

load(Array modules, Function callback) : void

Parameters

  • modules
    • Modules to lookup
    • Type: Array
  • callback
    • Function to call on finish
    • Type: Function

configure

Apply all routes to the given application.

Signature

configure(Object app) : void

Parameters

  • app
    • App to prepare
    • Type: Object