Handles rendering of the following:

  • API-Problem
  • HAL collections
  • HAL resources

 Methods

getApiProblem()

getApiProblem() : null | \PhlyRestfully\ApiProblem

Lazy-loads a helper plugin manager if none available.

getHelperPluginManager() : \Zend\View\HelperPluginManager

Returns

\Zend\View\HelperPluginManager

Whether or not what was rendered represents an API problem

isApiProblem() : bool

Returns

bool

Render a view model

render(mixed $nameOrModel, mixed $values) : string

If the view model is a RestfulJsonRenderer, determines if it represents an ApiProblem, HalCollection, or HalResource, and, if so, creates a custom representation appropriate to the type.

If not, it passes control to the parent to render.

Parameters

$nameOrModel

mixed

$values

mixed

Returns

string

Set display_exceptions flag

setDisplayExceptions(bool $flag) : \PhlyRestfully\View\RestfulJsonRenderer

Parameters

$flag

bool

Returns

Set helper plugin manager instance.

setHelperPluginManager(\Zend\View\HelperPluginManager $helpers) 

Also ensures that the 'HalLinks' helper is present.

Parameters

$helpers

\Zend\View\HelperPluginManager