Skip to content

Xerkus/zf-problem-details

Repository files navigation

ZF Api Problem

Build Status

Introduction

This module provides data structures and rendering for the API-Problem format.

Requirements

Please see the composer.json file.

Installation

Run the following composer command:

$ composer require "zfcampus/zf-api-problem:~1.0-dev"

Alternately, manually add the following to your composer.json, in the require section:

"require": {
    "zfcampus/zf-api-problem": "~1.0-dev"
}

And then run composer update to ensure the module is installed.

Finally, add the module name to your project's config/application.config.php under the modules key:

return array(
    /* ... */
    'modules' => array(
        /* ... */
        'ZF\ApiProblem',
    ),
    /* ... */
);

Configuration

User Configuration

The top-level configuration key for user configuration of this module is zf-api-problem.

Key: accept_filters

An array of Accept header media types that, when matched, will result in the ApiProblemListener handling an MvcEvent::EVENT_RENDER_ERROR event.

Key: render_error_controllers

An array of controller service names that, if matched as the controller parameter in the MVC RouteMatch, will cause the ApiProblemListener to handle MvcEvent::EVENT_RENDER_ERROR events.

System Configuration