PHP Class Imbo\Http\Response\ResponseFormatter

Author: Christer Edvartsen ([email protected])
Inheritance: implements Imbo\EventListener\ListenerInterface
Show file Open project: imbo/imbo Class Usage Examples

Public Methods

Method Description
__construct ( array $params ) Class constructor
format ( Imbo\EventManager\EventInterface $event ) Response send hook
getFormatter ( ) : string Get the formatter
getSubscribedEvents ( )
negotiate ( Imbo\EventManager\EventInterface $event ) Perform content negotiation by looking the the current URL and the Accept request header
setFormatter ( string $formatter ) : self Set the formatter

Method Details

__construct() public method

Class constructor
public __construct ( array $params )
$params array

format() public method

Response send hook
public format ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The current event

getFormatter() public method

Get the formatter
public getFormatter ( ) : string
return string

getSubscribedEvents() public static method

public static getSubscribedEvents ( )

negotiate() public method

Perform content negotiation by looking the the current URL and the Accept request header
public negotiate ( Imbo\EventManager\EventInterface $event )
$event Imbo\EventManager\EventInterface The event instance

setFormatter() public method

Set the formatter
public setFormatter ( string $formatter ) : self
$formatter string The formatter to set
return self