ZF\Apigility\Module::onRender PHP Метод

onRender() публичный Метод

Attach the ApiProblem render.error listener if a JSON response is detected.
public onRender ( MvcEvent $e ) : void
$e Zend\Mvc\MvcEvent
Результат void
    public function onRender(MvcEvent $e)
    {
        $result = $e->getResult();
        if (!$result instanceof HalJsonModel && !$result instanceof JsonModel) {
            return;
        }
        $app = $e->getApplication();
        $services = $app->getServiceManager();
        $events = $app->getEventManager();
        $services->get(RenderErrorListener::class)->attach($events);
    }