\MocaBonita\controllerMbController

Main class of the MocaBonita Controller

Summary

Methods
Properties
Constants
indexAction()
getMbRequest()
setMbRequest()
getMbResponse()
setMbResponse()
getMbView()
setMbView()
viewResolver()
create()
__call()
actionResolver()
No public properties found
No constants found
No protected methods found
$mbView
$mbRequest
$mbResponse
N/A
No private methods found
No private properties found
N/A

Properties

Methods

indexAction()

indexAction(\MocaBonita\tools\MbRequest  $mbRequest, \MocaBonita\tools\MbResponse  $mbResponse) : null|string|\MocaBonita\view\MbView|mixed

Example of index action

If the return is null, then it will call MbView from this controller and then render it (Common request) If the return is null, then it will print a message saying "No valid content has been submitted!" (Ajax Request)

If the return is string, then it will print the string (Common request) If the return is string, then it will add the string in the key "content" on the data (Ajax Request)

If the return is MbView, then it will render it (Common request) If the return is MbView, then it will print a message saying "No valid content has been submitted!" (Ajax Request)

If the return is mixed, then it will call a var_dump of the returned value (Common request) If the return is mixed, then it will print a message saying "No valid content has been submitted!" (Ajax Request)

Parameters

\MocaBonita\tools\MbRequest $mbRequest
\MocaBonita\tools\MbResponse $mbResponse

Returns

null|string|\MocaBonita\view\MbView|mixed

create()

create(string  $className) : \MocaBonita\controller\MbController

Controller Factory

Parameters

string $className

Throws

\MocaBonita\tools\MbException

When the controller is not an instance of MbController

Returns

\MocaBonita\controller\MbController

__call()

__call(string  $method, array  $parameters) : mixed

Handle calls to missing methods on the controller.

Parameters

string $method
array $parameters

Throws

\MocaBonita\tools\MbException

Returns

mixed

actionResolver()

actionResolver(\MocaBonita\tools\MbAction  $mbAction) : void

resolver action of controller

Parameters

\MocaBonita\tools\MbAction $mbAction