Zeta Components Manual :: Docs For Class ezcMvcController
MvcTools::ezcMvcController
Class ezcMvcController
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// |
Member Variables
protected string |
$action
Contains the action to run |
protected ezcMvcRequest |
$request
Contains the original request |
Method Summary
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. |
Methods
createActionMethodName
Creates a method name to call from an $action name.
Parameters:
Name | Type | Description |
---|---|---|
$action |
string |
__construct
Creates a new controller object and sets all the request variables as class variables.
Parameters:
Name | Type | Description |
---|---|---|
$action |
string | |
$request |
ezcMvcRequest |
Exceptions:
Type | Description |
---|---|
ezcMvcControllerException |
if the action method is empty |
createResult
Runs the controller to process the query and return variables usable to render the view.
Exceptions:
Type | Description |
---|---|
ezcMvcActionNotFoundException |
if the action method could not be found |
getRouter
Returns the router associated with this request.
setRequestVariables
Loops over all the variables in the request, and sets them as object properties.
Parameters:
Name | Type | Description |
---|---|---|
$request |
ezcMvcRequest |
setRouter
Sets the router associated with this request.
Parameters:
Name | Type | Description |
---|---|---|
$router |
ezcMvcRouter |