Stud.IP  5.4
DefaultRenderer Class Reference
Inheritance diagram for DefaultRenderer:
DebugRenderer JSONRenderer

Public Member Functions

 contentType ()
 extension ()
 render ($response)
 shouldRespondTo ($filename, $media_range=null)

Detailed Description

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.

Jan-Hendrik Willms
mlunz.nosp@m.ena@.nosp@m.uos.d.nosp@m.e GPL 2 or later
Stud.IP 3.0

Member Function Documentation

◆ contentType()

contentType ( )

Returns an associated content type.

String Content/mime type for this renderer

◆ extension()

extension ( )

Returns an associated extension.

String Associated extension for this renderer.

◆ render()

render (   $response)

Response transformation function.

\RESTAPI\Response$responsethe 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.

String$filenameFilename to test against
mixed$media_rangeMedia range to test against (optional, defaults to request's accept header if set)
bool Returns whether the renderer should respond

The documentation for this class was generated from the following file: