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.

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

Member Function Documentation

◆ contentType()

contentType ( )

Returns an associated content type.

Returns
String Content/mime type for this renderer

◆ extension()

extension ( )

Returns an associated extension.

Returns
String Associated extension for this renderer.

◆ render()

render (   $response)

Response transformation function.

Parameters
\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.

Parameters
String$filenameFilename to test against
mixed$media_rangeMedia 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: