Class: Controller

'brixy.mvc.Controller'~ Controller

new Controller ()

Base Controller object.

Source:

Methods

getRenderParams () → {Array}

Returns parameters that will be passed to the view.

Returns:
  • Array
Source:

getView () → {Object}

Returns controller's view.

Returns:
  • Object
Source:

processHandler (handler, view) → {string}

Runs the controller's handler.
Subclass has to define a method for each handler:
Ctrl.prototype.handleName = function(view) {...};

Parameters:
Name Type Description
handler string

Handler name.

view Object
Throws:
  • Exception

Returns:
  • string :
    • Result of handler.
Source:

renderView () → {string}

Renders the view.
View class has to define a render method:
View.prototype.render = function(arg1, ar2, ...) {...; return 'nextControllerHandlerName';}

Throws:
  • Exception

Returns:
  • string :
    • Returns the name of next handler method as a result of the view.render() method.
Source:

run (actionopt, dataopt) → {string|Object}

Runs the action.
Subclass has to define a method for each action:
Ctrl.prototype.actionName = function(data) {...};

Parameters:
Name Type Attributes Default Description
action string <optional>
'Default'

Controller's action. (optional)

data * <optional>

Action data. (optional)

Throws:
  • Exception

Returns:
  • string | Object :
    • Next application request.
Source:

setView (view)

Sets the view and params.

Parameters:
Name Type Attributes Description
view View | string
arg1, arg2, ... * <optional>
<repeatable>

Parameters will be passed to view.render() method. (optional)

Source:

toString () → {string}

Returns a string representation of the object.

Returns:
  • string
Source: