Default base content renderer class (outputs text/plain).
Content renderers are output filters that can reshape data before it is sent to the client. Each content renderer is associated with a certain content type and a certain file extension. This is neccessary for content negotiation.
- Author
- Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m
-
mlunz.nosp@m.ena@.nosp@m.uos.d.nosp@m.e GPL 2 or later
- Since
- Stud.IP 3.0
◆ contentType()
Returns an associated content type.
- Returns
- String Content/mime type for this renderer
◆ extension()
Returns an associated extension.
- Returns
- String Associated extension for this renderer.
◆ render()
Response transformation function.
- Parameters
-
\RESTAPI\Response | $response | the response to transform |
◆ shouldRespondTo()
shouldRespondTo |
( |
|
$filename, |
|
|
|
$media_range = null |
|
) |
| |
Detects whether the renderer should respond to either a certain filename (tests by extension) or to a certain media range.
- Parameters
-
String | $filename | Filename to test against |
mixed | $media_range | Media range to test against (optional, defaults to request's accept header if set) |
- Returns
- bool Returns whether the renderer should respond
The documentation for this class was generated from the following file: