Interface defining controller classes.
Controllers process the client's request and returns variables usable by the view-manager in an instance of an ezcMvcResult. Controllers should not access request variables directly but should use the passed ezcMvcRequest. The process is done through the createResult() method, but is not limited to use protected nor private methods. The result of running a controller is an instance of ezcMvcResult.
Source for this file: /MvcTools/src/interfaces/controller.php
Version: | //autogentag// |
protected string |
$action
Contains the action to run |
protected ezcMvcRequest |
$request
Contains the original request |
public static string |
createActionMethodName(
$action
)
Creates a method name to call from an $action name. |
public ezcMvcController |
__construct(
$action
, $request
)
Creates a new controller object and sets all the request variables as class variables. |
public ezcMvcResult|ezcMvcInternalRedirect |
createResult(
)
Runs the controller to process the query and return variables usable to render the view. |
public ezcMvcRouter |
getRouter(
)
Returns the router associated with this request. |
protected void |
setRequestVariables(
$request
)
Loops over all the variables in the request, and sets them as object properties. |
public void |
setRouter(
$router
)
Sets the router associated with this request. |
Creates a method name to call from an $action name.
Name | Type | Description |
---|---|---|
$action |
string |
Creates a new controller object and sets all the request variables as class variables.
Name | Type | Description |
---|---|---|
$action |
string | |
$request |
ezcMvcRequest |
Type | Description |
---|---|
ezcMvcControllerException |
if the action method is empty |
Runs the controller to process the query and return variables usable to render the view.
Type | Description |
---|---|
ezcMvcActionNotFoundException |
if the action method could not be found |
Returns the router associated with this request.
Loops over all the variables in the request, and sets them as object properties.
Name | Type | Description |
---|---|---|
$request |
ezcMvcRequest |
Sets the router associated with this request.
Name | Type | Description |
---|---|---|
$router |
ezcMvcRouter |