2017 © Pedro Peláez
 

library apigility-xmlnegotiation

Apigility XML Negotiation module

image

zpetr/apigility-xmlnegotiation

Apigility XML Negotiation module

  • Wednesday, January 25, 2017
  • by zpetr
  • Repository
  • 2 Watchers
  • 2 Stars
  • 187 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 11 % Grown

The README.md

apigility-xmlnegotiation

XML negotiation module for Apigility, (*1)


This module is inspired from abandoned ApigilityXml project. Thank you to Markus!

Necessary infrastructure to handle XML with ZF Apigility with HAL structure., (*2)

Response type is based on Accept header :, (*3)

  • request that specifies application/xml (or application/*+xml) get the content in XML
  • application/hal+json (or application/*+json) request get the content in HalJson as usual.

Installation

Install composer in your project, (*4)

curl -s http://getcomposer.org/installer | php

Define dependencies in your composer.json file, (*5)

{
    "require": {
        "zpetr/apigility-xmlnegotiation" : "1.*"
    }
}

Finally install dependencies, (*6)

php composer.phar install

or update it, (*7)

php composer.phar update

Usage

  • Add zPetr\ApigilityXml to config/modules.config.php:
    return array(
        ...,
        'zPetr\ApigilityXml',
        ....
    )     
  • Go to admin, select your API and change Content Negotiation Selector to HalJsonXML
  • Add application/xml to Accept whitelist and Content-Type whitelist. Add other headers if needed.
  • Save configuration

The Versions

25/01 2017

dev-master

9999999-dev https://github.com/zpetr/apigility-xmlnegotiation

Apigility XML Negotiation module

  Sources   Download

BSD

The Requires

 

by Petr Glushchenko

api xml zf2 module apigility negotiation