mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
commit
34f0fd4392
@ -67,16 +67,14 @@ It is standard in SilverStripe for your controller actions to be `lowercasewithn
|
||||
|
||||
Action methods can return one of four main things:
|
||||
|
||||
* an array. In this case the values in the array are available in the templates and the controller completes as
|
||||
usual by returning a [api:SS_HTTPResponse] with the body set to the current template.
|
||||
* `HTML`. SilverStripe will wrap the `HTML` into a `SS_HTTPResponse` and set the status code to 200.
|
||||
* an [api:SS_HTTPResponse] containing a manually defined `status code` and `body`.
|
||||
* an [api:SS_HTTPResponse_Exception]. A special type of response which indicates a error. By returning the
|
||||
exception, the execution pipeline can adapt and display any error handlers.
|
||||
|
||||
:::php
|
||||
* an array. In this case the values in the array are available in the templates and the controller completes as usual by returning a [api:SS_HTTPResponse] with the body set to the current template.
|
||||
* `HTML`. SilverStripe will wrap the `HTML` into a `SS_HTTPResponse` and set the status code to 200.
|
||||
* an [api:SS_HTTPResponse] containing a manually defined `status code` and `body`.
|
||||
* an [api:SS_HTTPResponse_Exception]. A special type of response which indicates a error. By returning the exception, the execution pipeline can adapt and display any error handlers.
|
||||
|
||||
**mysite/code/controllers/TeamController.php**
|
||||
|
||||
:::php
|
||||
/**
|
||||
* Return some additional data to the current response that is waiting to go out, this makes $Title set to
|
||||
* 'MyTeamName' and continues on with generating the response.
|
||||
|
Loading…
Reference in New Issue
Block a user